I have a mesh that turns as I rotate my mouse around it, but I need to check how many times it gives a full turn, and I only get negative values in my print Strings when I check the rotation.
I tried to set a rotator that adds the initial value of the rotator to the look at rotator and sets this rotator, which then checks how many turns has it made through by checking if the rotation I did is over 360, which does not work.
If I multiply this value for -1, it is always on instead.
Can anyone give me any suggestion on how to check how many times an actor has made a full turn when we rotate it? Thanks in advance.
Hi man , is quite simple,
When you add the rotation to the actor , lets say addrelativerotation(5,0,0) or (-5,0,0)
You add the same amount to a float variable MY_ROTATION.
This value may be any number <0 and >0 . Use the node ABS , and pin in the value of your value.
This will return your value to +positive. Then /360 and you get the number of full turn you made to it.
You can also check if the number is <0 or >0 to know if were turn to right or left.
Hey Est_Engine, many thanks for the help. It doesn’t work for me, I have a set world Rotation into my mesh which the rotation is calculated by following the mouse position.
I plugged it using an ABS, then divided by 360, then printed, the value never goes beyond 0.
Bump, could anyone give me any hints towards what I’m doing wrong?
Hi man , this work fine for me, i use the rotate world , but store the amount of rotation.
This print out values like 0.5 (half turn), 1 (1 perfect turn) 2.7 (2 turn and 7/10).
This work for both rotation , placing the value to -2 it will turn clockwise and returning the same 1.1 , 2.7 …
I understand now, thank you very much!