You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
472 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WheelController : MonoBehaviour {
public Vector3 rotateDirection;
public float rotateSpeed;
public bool isRotating;
void Update ()
{
if(isRotating)
{
//Rotate the selected wheel in the direction
//chosen at rotateSpeed Speed
//if isRotating is checked in the inspector.
transform.Rotate(rotateDirection * rotateSpeed * Time.deltaTime);
}
}
}