Problem with movement

I have made a tank on my game, by parenting different cubes and cylinders together. The script for its’ basic forward and side movement is:

var speed = 50;
function Update () {
var x = Input.GetAxis(“Horizontal”) * Time.deltaTime * speed;
var z = Input.GetAxis(“Vertical”) * Time.deltaTime * speed;
transform.Translate(x, 0, z);
}

When I move it, it goes that direction, but it kind of leaves itself behind. It’s hard to explain, it sort of smudges itself onto the ground

I don’t understand what’s really your problem, but if you want a bassic movement you can do it in a one line

var Speed = 50;

function Update(){
transform.Translate(Input.GetAxis("Vertical") * Speed * Time.deltaTime, 0, Input.GetAxis("Horizontal") * Speed * Time.deltaTime)

}

Also, I recommend you to create an empty gameobject as a Parent of the others, and attach the script to it.