i’m brand new to unity and c# so i’m completely in the dark right now
i’m trying to make some limited character movement so you can move forward and back with the up and down arrow keys and rotate side to side with the side arrow keys. i’ve got the forward and back part but i can’t seem to get the rotation to work.
i’ve tried looking at a bunch of fixes for similar questions on here and youtube but none seem to work, possibly because they’re outdated or i’m not putting the code in the right places.
not sure if this would be helpful but here’s where i’m at right now
void Start()
{
}
void Update()
{
inputX = Input.GetAxis("Horizontal");
if (inputX != 0)
rotate();
}
void rotate()
{
transform.Rotate(new Vector3(0f, inputX * Time.deltaTime, 0f));
}