Hey all,
I am trying to make it so that when an object is moving towards a location, it will play the corresponding animation. For example, if their angle of movement is between 315 and 45, it plays the 'Right' animation.
To calculate the angle, I have a family instance variable called AngleTracker which is set to 'angle(minions.x, minions.y, sprite9.x, sprite9.y)' as long as an enemy has instance variable 'Selected' to 1.
I can get it to all work fine for right, down and left, but for some reason up (>225, <315) just won't work. They will still move in the correct way, but won't change their animation, instead always reverting to the 'Right' animation (>315 OR <45).
I am guessing the issue has something to do with the fact that 'Right' uses an OR block, but I don't know how to get around that.
Here's a link to the capx if someone could have a look for me, but be aware it uses 'moveto' and 'pushoutsolid' behaviours:
dropbox.com/s/sb77z480hrvq4xl/Example.capx
I also tried to do it by pinning a pointer to each instance and point them towards the target and having each instance play the animation in accordance with their pointer's angle, but instead they would all reference only a single pointer's angle. If you have any ideas on that method it would also help!
And just quickly, if anyone knows which path finding plugin would work best for this type of game it would be nice, I have only had a quick look at them so far.