I managed to get some more intel, I was sure the state machine was wonky but, in fact, not !
Problem seems that it goes straight to fall state but gravity seems to not apply : I tried to move the player and he doesn't fall at all:
`extends BaseState
export (float) var move_speed = 60
func physics_process(delta: float) -> int:
var move_direction := Vector3.ZERO
move_direction.x = Input.get_action_strength("right") - Input.get_action_strength("left")
move_direction.z = Input.get_action_strength("back") - Input.get_action_strength("forward")
move_direction = move_direction.rotated(Vector3.UP, player._spring_arm.rotation.y).normalized()
player._velocity.x = move_direction.x * move_speed
player._velocity.z = move_direction.z * move_speed
player._velocity.y -= player.gravity * delta
player._velocity = player.move_and_slide_with_snap(player._velocity, player._snap_vector, Vector3.UP, true)
if player._velocity.length() > 0.2:
var look_direction = Vector2(player._velocity.z, player._velocity.x)
player._model.rotation.y = look_direction.angle()
if player._velocity.y > 0:
return State.Fall
if player.is_on_floor() and player._snap_vector == Vector3.ZERO:
if move_direction != Vector3.ZERO:
return State.Walk
else:
return State.Idle
return State.Null
func _process(_delta: float) -> void:
player._spring_arm.translation = player.translation
`
Now, I need to find why gravity doesn't apply...
edit : Yeah...calculating a velocity but not applying it isn't helping.
I managed to make my character move with the move and slide w/ snap but it's still stuck in the fall state : I think it is due to the snap vector not changing back to 1.