0 votes

So I wrote

if Input.isactionpressed("moveforward"):
direction -= head
elif Input.isactionpressed("movebackward"):
direction += head

if Input.isaction-pressed("moveleft"):
direction -= headbasis.x
elif Input.isactionpressed("moveright"):
direction += head

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?

asked Jul 3 in Projects by EliLFrench2005 (12 points)

1 Answer

+2 votes

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

answered Jul 3 by frankiezafe (86 points)

Great fix! Thanks much!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.