For some reason, my cube starts moving rapidly without any input when I hit play. I know its something wrong with my code but the thing is I copied it directly like in the course and this started happening, I tried a bunch of other codes but it still gives the same result, can someone please help me?
HERE IS THE CODE:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Mover : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
//Update is called once per frame
void Update()
{
float xValue = Input.GetAxis("Horizontal");
float zValue = Input.GetAxis("Vertical");
transform.Translate(xValue,0,zValue);
}
}