So for my halo game. I have coded his head to move and look up and down, but the problem is you can rotate in a full circle. How do I make it so that the head cannot rotate 360, and turn it like us humans.(looking up, looking down but down down)
So here is how it looks if the sprite looks at the mouse on top- left corner
Here is how it looks it you look down mouse down-right
How I ant it to be
So technally if you try to do this
it would not work and would stop you from doing that. But how?
If rotation is > 45 then don’t move the head.
If rotation is > 135 flip the head and allow it to move.
For the up direction If rotation is, > 225 don’t let the head move.
If the rotation is > 315 let the head move again and flip it back.
These values would need to be adjusted to be what you need, this is just an example.
Thank you CodeAlpaca!
So tehnally the > is less than for the filter but what is “if” as a code?
So if it rotates to 45 how to stop it?
X > 45 means that X is greater than 45.
Use an extractor to get the Rotation, then with that, you can use different filters to stop/allow rotating in a specific direction. (I did this in my head so there may be slight adjustments you’ll need to make)
Thanks CodeAlpaca again couldnt have done it without your help! I have also added this to some other spirtes!