Hey all! Been scrapping together a quick platformer to prototype. I’m using the Defold Platformer example and have only changed out the sprites. Problem is the player script keeps switching from different animation states.
You can see the issue here.
I think the issue might be in some where in this block
local function update_animations(self)
-- make sure the player character faces the right way
sprite.set_hflip("#sprite", self.move_input < 0)
-- make sure the right animation is playing
if self.ground_contact then
if self.velocity.x ~= 0 then
play_animation(self, anim_run)
else
play_animation(self, anim_idle)
end
else
if self.velocity.y ~= 0 then
play_animation(self, anim_jump)
else
play_animation(self, anim_fall)
end
end
end
Appreciate any suggestions, thanks!