How to make a normal WASD controller

I’ve created a character controller script for a third person character, but it isn’t working (I’ll upload it in a .txt file) it has two errors:
(Assets/CharacterMovement.cs(24,14): error CS0501: `CharacterMovement.Start()’ must have a body because it is not marked abstract, extern, or partial)

(Assets/CharacterMovement.cs(26,14): error CS0501: `CharacterMovement.SetupAnimator()’ must have a body because it is not marked abstract, extern, or partial)

I need it to be something like W for forward, A+W for left-forward, etc and mouse to move the camera (in a third person character)
The next I’m going to ask maybe is impossible or too difficult: Is it a way to connect for example a ps3 controller to an unity 5 game? And if it’s possible, how can I change the controlls to adapt it to the ps3, xbox or psp controller?
Thank you very much.[56865-charactermovementthirdperson40.txt|56865]

Delete “void Start();” and “void SetupAnimator();”. Never use semicolons when declaring functions. Also, there is no reason to declare a function that does nothing.

@ IvanOmega60

As for the “WASD” controller, this is every easy! Unity actually ships “WASD” controls and you can access them by typing the following:
Input.GetAxis(“Horizontal”);

for the “A” and “D” keys, and

Input.GetAxis(“Vertical”);

for the “W” and “S” keys.

As for the mouse, that gets a bit more complicated, and I’m gonna let someone else do that (look at my name for explanation)

As for the game controllers, yes! Unity does support game controllers. Go into
Edit-> Project settings → Input

after that, a quick google search for “Setting up a Xbox controller in unity” should get you on your way. Again, look at my name for explanation as to why I’m not going into further detail :wink:

NOTE: the Xbox 360 and Xbox 1 controller mappings are the EXACT same!

if you don’t define a body for the Start method in a script that inherits form MonoBehavior then you don’t to list its name, so you can delete that. As the compiler is telling you theres no body for the SetupAnimator and is expecting the terms “abstract, extern, or partial”. If CharacterMovement is planned to be a parent class then you should mark that method an abstract method. And give it an accessibility level… i.e public or protected… a private abstract method is another error.

for example:

public abstract void SetupAnimator();

unless you’re not planning on using it, then you should just delete or comment it out.

now to make your controller cross-platform supported. I would highly recommend you use the Input class and the Input.GetAxes and Input.GetButton that Unity has setup for you. It can save you a lot of headaches for most control schemes as unity has done all the architecture for you. I can recall when I first started with Unity I coded up my entire Input interface for cross platform support while not knowing about this feature.

the Input Class enables you to think of your controls as platform-independent actions and even give you the foundation to make it possible to remap controls to whatever you like while playing the game.

To see the Axes that are defined you can go to edit->Project Settings->Input, and the information will populate the inspector panel