My player will only move right? Please help.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By EliLFrench2005

So I wrote

if Input.is_action_pressed(“move_forward”):
direction -= head_basis.z
elif Input.is_action_pressed(“move_backward”):
direction += head_basis.z

if Input.is_action-pressed(“move_left”):
direction -= headbasis.x
elif Input.is_action_pressed(“move_right”):
direction += head_basis.x

All movements are defined in the input map,
And I have no error warnings at the bottom.
The player will only move right.
What did i do wrong?

:bust_in_silhouette: Reply From: frankiezafe

What is the type of direction?
If it’s a Vector3, you should do direction**.x** += headbasis.x & direction**.z** += headbasis.z instead

Great fix! Thanks much!

ifitnessvn | 2020-07-04 16:06