Hello, could someone help me? Is that I wanted to know how to make the bot/enemy produce the animations on the diagonals. I did it in the 4 directions using the angles, but I can’t do it in the 8, I’m moving it hard.
Welcome! Can you share a screenshot of the events to have a better idea how you setup the movements and animations?
Thanks, yes.
I can’t get it to play the animations on the diagonals, only in the 4 directions
Sorry for the delay.
I was trying to send it through the comments but it was giving an error, put it there in the post my screen
Weird! no worries.
Did you try the in-between angles?
Example: angle 45 is for down-right animation (between 0 and 90).
I’m not sure if the angle of movement calculates angles between 0 → 360, but usually GDevelop calculate angles from 0 →180 (clockwise) and 0 → -180 (counter clockwise).
Check the image in this post for reference:
Hi Games,
I don’t know if I understand the problem properly. Your events show that you are only using four directions when you want eight. My first pic shows what you have. The second pic shows eight directions.
But you can do things differently if you save the bot angle to a variable.
varBotAngle = mod(round(Bot.Angle() / 45), 8)
Change the number of the animation of Bot to varBotAngle
I’m not sure whether your movement will say ‘Angle’ or something else.
The 8 is how many directions you have. The 45 is 360 divided by 8. If you have your animations in the number order like my second picture then the animation number will automatically line up with the calculated number in the varBotAngle variable.
That was it,
Now he walks in 8 directions.
Thank you
Sorry for my english I’m using the translator