The array is a flat grid that can change dynamically.
I have for each spot their XID, ZID, Current point ID from the total array.
How do I calculate the base rotation+beam rotation, so all the spots point to the center? 0,0,0 ?
The easiest way, is to make sure your component hierarchy is correct.
You need to have something you can rotate for each of these operations, just like real life.
Depending on the structure of the blueprint, this might actually be part of the model, but more typically, it would be additional scene components.
When you say, all pointing at 0,0,0 do you mean they should all point to the same location? Or should they all point in a grid, like your first picture?
With the base rotation + spot rotation, it’s possible to rotate each light in any direction needed, but I don’t know how to calculate the “Center aim” for all of them via blueprints.
I want that all the beams will point towards the same point (center point or actually any other point, but 0,0,0 would be a good start)
How can I use that assuming two rotation values? since I have one for the base, one for the beam - just like real life actually so I’m not sure how to calculate it
That would work if the rotation would be one value,
but it’s 2 different ones for each object in the hierarchy.
With Look At Rotation on both of them, I get this:
you didnt break the rotation, you only want the zaw for the base and the pitch for the light. you may need to offset it depending on the default rotations but should work
the code is correct, is the base the root component? because if so see how the forward vector is pointing down not forward so that could mess things up.
So the pivot on the spot is good, the pivot on the base is not. You’ll need to put a scene component on the base to correct it ( because ‘look at’ always assumes X is pointing forward, and the base is using Z ).
Then you can use ‘look at’, but you’ll need to limit both of them to some axis only.
there are lots of ways to change the pivot but if you dont want to you can just ‘fake’ it, ie pitch is now roll so just test with different pins until it matches what you want