Hello,
I was trying to merge a 3D movement with a state machine tutorial together in an experimentation.

I managed to squish most of the IDE error but my player isn't moving : it respond to input relative to the camera and face it's spawn orientation once the key's released...

it does feel like the state machine work since it can change direction only in the walk state and the initial state is Idle

walk

extends BaseState

export (float) var move_speed = 60

func input(event: InputEvent) -> int:
	if Input.is_action_just_pressed("jump"):
		return State.Jump
	return State.Null

func physics_process(delta: float) -> int:
	if !player.is_on_floor():
		return State.Fall

	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
	
	if player._velocity.length() > 0.2:
		var look_direction = Vector2(player._velocity.z, player._velocity.x)
		player.model.rotation.y = look_direction.angle()
	
	if move_direction == Vector3.ZERO:
		return State.Idle

	return State.Null

func _process(_delta: float) -> void:
	player._spring_arm.translation = player.translation

I'm not even sure what is happening right there, Feels like the state machine isn't working correctly but I struggle to debug it (I managed to print the states.name but it only give me the node name : state_manager).

Got the project under for anyone wanting to dig around and give feedback.
https://mega.nz/file/Uw93xTjS#syYoLmLy8JusCXQKr3yHzrzssjQ3ufuagBQ2znD0SHY

    RaymontP I suggest throwing in print statements to see if the values of state, move_direction, ect are what you expect them to be at any given time while playing. You could then compare to how things worked before if you kept an older version with git.

    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.