Offsetting lights placed along a spline AFTER rotation

Hi, I’m creating a flexible festoon lights blueprint - I can get my mesh to conform to a spline and place meshes along it for the lamps. I have added a random twist to the lamps, but I cannot get the UE lights I create to follow.

I would need to take the rotation of each lamp and offset a point light along the Z axis, to get the light in the right place (approx -10 units)… see example:

However, whatever I have tried has produced very random results.
The lights either all follow the cable, follow the cable but are offset in line, or cluster together in their own random ways…

How do I take the rotated meshes (A) and use them as a ‘parent’ to offset the point lights in the correct direction in each case (?)

Thanks in advance!

Hey @bgeviljim how are you?

To create this kind of spline, I recommend you to use something like this BP:

  1. Add a Spline Component and an InstancedStaticMesh component to your BP

  2. Create a float variable called “SpacingDistance” and set its default as you want:

  3. In the construction script start by calculating the amount of bulbs that fits in the spline based on the spline length and the spacing distance. You will use it in a for loop:

  4. The for loop should be like this:

With that, you should be able to generate random rotations without any issue!

Quick advise: be sure to set the “Coordinate Space” for both nodes “Get Location at Distance Along Spline” and “Get Rotationat Distance Along Spline” to “World”, and set “World Space” true on the Add Instance node!

Let me know if it works for you!