Creating array of Point Light Components within a BluePrint (and possible bug)
I have a base blueprint which will be used to create several others that will all share some specific functionality. One such function is that a number of lights will light up depending on a changing integer value on each instance of the object. Each instance will have a different number of lights, so I can't just hard code it.
My attempt to do this was to use an array of Point Light Component References. However, you can't set the default entries on such an array with existing PLCs in the current BP scene, which seems odd. I tackled this by having the construction event add each light one at a time to the array, which is obviously a fudgy solution.
PLC Lights in the BP scene and not showing in array add interface
I have two things, one question and one possible bug:
Q: How can I have a predefined array on a BP that I can set each element to an existing Point Light Component in the BP scene - OR - a way to achieve the same goal in an automated/expandable way (not manually add them).
BUG: When I run my game in the editor, I'm seeing a random number of either "Nothing" entries getting added to the PLC array, or sometimes items called "TRASH...(I can't make it do it right now and can't remember the rest of the line)". I can remove them at runtime to prevent issues, or clear them between runs with the "Trash" icon on the array, but they'll come back when I stop and run again (but not always, often depends if I edit the blueprints or some such).
Array when its behaving
Array when random "None" entries show up
asked Jan 10 '16 at 09:02 AM in Blueprint Scripting
Here's how to add lights dynamically using only a variable + construction script.
Here it is in action
Follow this question
Once you sign in you will be able to subscribe for any updates here