as you can see in this video:
the objects rotating were expected to push themselves forward like cars of a wheel do, but unfortunately this doesn’t appear to be the case. to rotate the objects i’m using theese lines of code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class rotaet : MonoBehaviour
{ private float rotZ;
void Update()
{
rotZ += Time.deltaTime * -500;
if (Input.GetKeyDown("f"))
{
}
transform.rotation = Quaternion.Euler(0, 0, rotZ);
}
}
are there any easy ways for me to fix it?