Skip to content

custom state:set_can_control_direction(true) is ignored if state:set_can_control_movement(false)

Custom states only allow the player to control the hero's directionif they can also control the hero's movement. This makes it so you can't create a state where the hero cannot move, but can pivot around in different directions.

Test:

function map:on_opening_transition_finished()
  local state = sol.state.create()
  state:set_can_control_movement(false)
  state:set_can_control_direction(true)

  function state:on_started()
    print"State started"
  end

  hero:start_state(state)

end

Add this code, then try to change the hero's direction

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information