Everything is synchronized now
Ok, so I took a look, and from what I can tell moving left, right and up works, while down doesnât. This can be seen as an error in one of your screenshots ("Unable to play animation âPlayer Downâ since it could not be found). It wasnât obvious what was wrong really, since the atlas seemed to have the Player Down animation (as can also be seen in the same screenshot).
The tricky thing was that there was a trailing space character at the end of the animation group name, meaning that the animation was actually named "Player Down " <-- not trailing space here. It can be seen when selecting the text:
Ok but besides from that if you try to move the character around itâll let you but if you go up it wonât let you stay on any other idle animation besides up
Isnât that because out of the four if-elseif cases for the idle animation it is always the first one (up) that evaluates to true? You need to rethink that logic.
All of them are set to false though.
Yes, exactly. If you release all keys then self.direction.x and self.direction.y will be set to 0. This means that self.direction.x == 0
evaluate to true. And so does self.direction.y == 0
. And you say yourself that self.actions[hash("Up")] == false
evaluates to true.
This means that:
if self.direction.x == 0 and self.direction.y == 0 and self.actions[hash("Up")] == false then
play_animation(self, hash("idle_up"))
Translates to:
if true and true and true then
play_animation(self, hash("idle_up"))
Which leads to it always using âidle_upâ.
Any Idea how to fix it