Issues with 2d Movement

Hello, I’m attempting to make my character move on a 2D plane without the use of Character Controller. The issue I’m running into here is that I have the movement established, but for some reason Unity is giving me errors about it that I’m not sure how to fix.

var x = float;
var z = float;

x = Input.GetAxis("Horizontal") * speed * Time.deltaTime; 
z = Input.GetAxis("Vertical") * speed * Time.deltaTime; 
transform.Translate(x, 0, z);

The issues I’m getting are
Cannot convert ‘float’ to ‘System.Type’ for both x and z

and

No appropriate version of ‘UnityEngine.Transform.Translate’ for the arguement list ‘(System.Type, int, System.Type)’ was found.

No idea why this is happening, to my knowledge this should be working.

I’m a C# programmer but I’m pretty sure for JavaScript the proper syntax would be:

var x : float = 0.0f;
var z : float = 0.0f;

function Update() {
     x = Input.GetAxis("Horizontal") * speed * Time.deltaTime; 
     z = Input.GetAxis("Vertical") * speed * Time.deltaTime; 

     transform.Translate(x, 0, z);
}

Look here for an example:

Oh wow I can’t believe I didn’t notice that haha. Thank you very much for your help!

It happens. Good luck!