Per-instance component properties

Let’s say I have a blueprint that contains a static mesh and a point light.

How can I change the position of the light for a single instance of that blueprint? (Like the old prefabs).

Thanks!

You need to utilize the Construction Script for stuff like this. It calculates prior to runtime. Toss in a variable, and you’re golden.

I did it for proof-of-concept. Here are my steps:

  1. Make your Blueprint
  2. Add your mesh and Spotlight
  3. In your Construction Script, bring in a Get for the Spot Light
  4. Create a Set Relative Location node, connected to the Spot Light
  5. Create a Vector Variable. Let’s name it something like Light Location
  6. In its properties, be sure to make it editable, give it a tooltip, and most important: check Show 3D Widget (this is the cool part!!)
  7. Make a Get for the new Light Location Variable, and connect it to the New Location input on the Set Relative Location node
  8. You’ll probably have to tweak the Default value for the vector to a good initial position for the light. Do that in the Default tab.

Now you can bring in as many of these lights as you like. When you select one, you’ll see a little diamond-shaped (and labeled! how awesome is that!!?!) widget you can move around to reposition the light. This can be unique for each instance.

(I did 2 because the lamp post I found had 2 lights on it!) :slight_smile:

spotlight3.png

Sorry I didn’t see your answer earlier. Sounds good, thanks!