Invert Rotator on only one axis

Hi everyone,

I have a object that should mirror the player transform.
On every tick I take the player transform and invert the position on the Y-axis and use this as the new position of my object.
Now I am stuck on the rotation.
If I invert the rotator everything works, until the player looks up. Then the object is looking down, but it should look up as well.
I tried to break the rotator and just inverted the yaw vector, but this does not work. I tried all the other axis, but no one worked as expected.

Is there a node that lets me mirror a rotator on only one axis?

Cheers,

Evil_Fischi

Can we see some code?

1 Like

You might want to try using a transform multiplication to mirror your movement, If you made a transform that has its rotation set to “point” along your mirror normal and had the x scale be negative 1 it might flip.

What about just copying the rotation, but then adding a 180 turn in the Z with CombineRotators?

2 Likes

Found a solution:

When you brake the rotator, the roll, pitch and yaw integer are limited from 0 to 360.
So when you just multiply the yaw value by -1 you get an invalid input.

Now I multiply my yaw with -1 and add the outcome to 360.

This doesn’t work. Firstly a circle in Unreal is 180 degrees to -180 degrees, and secondly, if you want the opposite rotation, you just need to add 180 degrees to it. So you don’t need to invert your yaw, just add 180 to it.

2 Likes

Actually worked . It’s been years but thx

1 Like