I'm trying to make a collision test on a custom entity that changes the hero animation while overlapping. Setting the animation works, but the animation persists outside of the entity until the hero stops moving. What do I do to fix this?
This is the chunk:
This is the chunk:
Code ( lua) Select
entity:add_collision_test("overlapping", function()
if entity:overlaps(hero) then
hero:set_animation("spring")
end
return true
end)