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.
20 lines
465 B
20 lines
465 B
3 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class CarMonitor : MonoBehaviour {
|
||
|
public List<WheelCollider> wheelColliders;
|
||
|
|
||
|
// Use this for initialization
|
||
|
void Start () {
|
||
|
|
||
|
}
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void Update () {
|
||
|
foreach (WheelCollider wheels in wheelColliders) {
|
||
|
wheels.GetComponentsInChildren<Transform>()[1].localEulerAngles += new Vector3(wheels.rpm * 6 * Time.deltaTime, 0, 0);
|
||
|
}
|
||
|
}
|
||
|
}
|