Hi everyone,
I would like to know the best way to refer to angles when I need to check if an object or behavior angle is within a certain range.
As an introduction, I noticed that when I put an object's angle or the movingAngle expression of a moveto behavior into a variable, the result is a variable ranging from 0 to 359.999
When I do the same with the angleOfMotion expression of a Bullet behavior, the result is an angle ranging from -179.999 to 180.
That alone is quite complicated to deal with, as I use both MoveTo and Bullet behaviors in my code.
Now here's the kind of thing I'm using in my code in order to play the correct animation based on an angle:
I have the feeling that I am doing something wrong. Is there a more efficient way to play an animation based on an angle than the one showed above?
By the way the code above works for a moveto behavior. For a bullet behavior (shotAngle variable set to bullet.angleofmotion) I'll have to change every value above 180 by their negative counterparts or it won't work.
Bonus question : Is there some way to tell C2 that a certain variable is an angular value? i.e. convert every value above 180 to their negative counterpart or the opposite. That would already help me with the 270°/-90° problem.
Thanks !