I am trying to align two actors A and B by adding the difference of the rotation of A and B to the rotation of A - just like you could make it to align it’s locations (A.location = A.location + (B.location - A.location). Don’t ask why I am doing it this way and why I not simply set the rotation of A to the rotation of B - I need to do it this way for another function. It should work, anyway.
When calling the function “New Function 0” (in the level blueprint) with the location this works without any problems. If I am doing the same with the rotation this happens:
It’s inaccurate! The rotation of both cubes is not the same. If I call “New Function 0” again (2 times at all), it’s slightly more accurate:
After three calls:
After four calls it looks good. Both cubes have almost the same rotation:
I think it’s clear that this has something to do with inaccuracy. I need to call the same function 4 times to get a good result.
How to deal with this? What is the problem? How to make it better so that I don’t need 4 calls?
I am trying to align two scene components on their sockets, so that at the end both sockets have the same rotation and the same location. So I thought this would work:
Move Component 2 for the difference of the socket locations of Component 2 and 1 -> both sockets have the same location
Rotate Component 2 for the difference of the socket rotations of Component 2 and 1 around the socket of Component 2 -> both sockets **should **have the same rotation
There are cases of rotations of Socket 1 and Socket 2 where:
this works
this does not work, but it works with (5-10) iterations of this function