Enable Always W-A-S-D to same direction

Hello

Can you please assist me with how to write a simple script so that my W-A-S-D keys are always going same direction?

I have a third person character controller with its own camera system. I use the WASD keys and it works as intended, so when pressing the “W” key he moves in the forwasrd / z direction.

I have a car system as well which uses its own camera system and when i have that specific gameobject with its camera system on, then my WASD are going the opposite directions…

Hope it makes sence…

public KeyCode Up;
public KeyCode Down;
public KeyCode Left;
public KeyCode Right;
public KeyCode A;
public KeyCode Start;

on your directional movement. Ask for all directions to result the same thing OR

public List<KeyCode> OneDirection;

I’ve never actually used a public list of a KeyCode to ask if a input getkey was contained in the list of the key codes so many somebody else can confirm if that’s even viable

1 Like

Could you post your code? Maybe you get your directions mixed up?