Greetings.
In my game, I just finished walking animations for my character. I edited the code so that it plays the walking animation whenever the character’s hitbox is moving and on the floor.
However, during preview, the game just freezes whenever I try to move on the floor.
As far as I understand there is no position change while keys pressed, try to use “apply forse” action and choose the needed angle 0 or 180 (left, right). And to make the animation work correctly set it to start while key is pressed.
I previously had the keypress options in the “playerhitbox is moving” event earlier and it didn’t work.
I have two other scrapped projects that use the same system, and they both work properly, so there must be a bug with the points or something.
Also, is using forces the solution, or a temporary workaround?
Yes, the hitbox is on the floor. The player has no collisions, only his hitbox does.
Also, it worked before I made the animation, but now when it tried to load the animation, it freezes.
Okay so firstly you’ll need not only to set the animation to “walk” but also add the “play animation” action. But the thing is that I can’t quite understand the playerhitbox object there, what is it? You’ve created an object named hitbox?
My character kind of has a wider sprite, and the middle of his body doesn’t quite meet the center of the sprite, so when he flipped around, he would clip outside of his own hitbox.
So I asked for help on these forums and fiddled with the points for a while until I got the hitbox to be perfectly centered. To make this work, I added a third point to the player to signify where the hitbox goes.