How do you stop the movement while keeping the jumping state?
I have tried with hero:stop_movement(), but the hero stays frozen. If I add hero:unfreeze(), I recover the control of the hero, but this also seems to stop the jumping state... Am I doing something wrong? The code I am using is:
EDIT: I forgot to add the methods, hero:get_solid_ground_position() and hero:reset_solid_ground().
I have tried with hero:stop_movement(), but the hero stays frozen. If I add hero:unfreeze(), I recover the control of the hero, but this also seems to stop the jumping state... Am I doing something wrong? The code I am using is:
Code Select
function item:on_using()
local hero = self:get_map():get_entity("hero")
local direction4 = hero:get_direction()
hero:start_jumping(direction4 * 2, 32, false)
hero:stop_movement()
--hero:unfreeze()
hero:set_animation("black")
--self:set_finished()
end
EDIT: I forgot to add the methods, hero:get_solid_ground_position() and hero:reset_solid_ground().