I am trying to get the rotation of my characters hands and see if each value separately is within a threshold. basically, I want to see if the hand is at 180 degrees with a threshold of 20 degrees otherwise saying I want to see if its x value is within 200 degrees and 160 degrees, and mi doing the same with the y and z but with other values. I have tried doing it with Euler angles and pretty much everything else. I’m very lost and am not the bet with rotation so if anyone knows how I would do this it would be very helpful.
This is for a hand sign magic kind of like Naruto if that helps.
so i have tried it with Euler and the other and it has not worked, i am setting the target angle to 180 and tolerance to 20, this has just always come back false
yes, i have done this and as it hits 90 degrees it always inverts and starts decreasing. I know this is because Euler changes the other variables and thats why im trying to find a way to get the rotation as 0-360, not 0 to 90 or 180
We’re talking here about one axis right? (your “hand” rotates around one axis only?) My function takes care of the range 0-360, so it’s not the problem.
What i am trying to do is test when the hands are at a certain position(Done)
doing a certain pose(Done)
and rotated in the right angle(Having issues)
this is a vr game and I’m trying to add hand signs as the way you do magic
The function I gave you works. As I said, do the logging I suggested and check the values printed in the console vs the one in the Editor and see if you’re passing the correct angle. If your Euler angle does not exceed 90 as you said, there’s something wrong in the way you calculates/assign the hand rotation itself, as it should continue increasing to 360 and go back to 0. Show us the code you use to assign the hand rotation.