Rotate actor down in the direction of looking

I am trying to achieve the following effect;

ezgif-5-3f65857c0f

regardless of the location or rotation of the actor.

So far I have managed to move actor location from one side of the box to the other downwards in the direction I have my camera facing by creating the component in the appropriate local location and using its coordinates in this way;

However, I cannot cope with the rotation, for daysI have been messing with different nodes, it always works maybe up to two rotations and with next the camera spins and ends up in the wrong place. I even tried changing actor rotation towards the component on the underside of the actor, or localrotating this component and copying its worldrotation to the actor, but the effects are the same!

I approached success by creating a new component in the tree so that I rotate one component relatively horizontally and the other vertically.
The first problem was on the third spin forwards, instead of going forward it was going backwards, so I created a condition that checks this position and goes not -90 Pitch but +90 Pitch with it and it works.

Until a certain combination of rotations that ends in strange coordinates like;
Pitch 90 Yaw 35 Roll 35
and after this I rotate, I end in such a distortion;

2ezgif.com-gif-maker

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms