4.5.stable
I am trying to make a character controller and I can’t get my character’s animations to rotate correctly. when i am facing a certain direction everything is fine but when i turn right or left the moving forwards will play strafe left or right. I did follow a tutorial i followed previously to set up a statemachien witha animation tree but i didnt remeber how
func get_move_input(delta):
var vy = velocity.y
velocity.y = 0
var input = Input.get_vector("Left", "Right", "Forward", "Back")
var dir = Vector3(input.x, 0, input.y).rotated(Vector3.UP, spring_arm.rotation.y)
velocity = lerp(velocity, dir * speed, acceleration * delta)
var vl = velocity * rotation.normalized() # this is my suspect
anim_tree.set("parameters/IWR/blend_position", Vector2(vl.x, -vl.z) / speed)
velocity.y = vy
model is the player
and here is my scene tree
