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.