Crash when trying to start a movement in on_state_changed() event
Sample code :
local hero_meta = sol.main.get_metatable("hero")
local movement=sol.movement.create("straight")
movement:set_speed(88)
movement:set_angle(3*math.pi/2)
function hero_meta:on_state_changed(state)
print("STATE CHANGED:"..state) --triggers three times on map startup. is this the cause ?
if state == "free" then
print "PULL ME DOWN" -- this displays well
movement:start(self) -- <-- crash
end
end)