using System.Collections; using System.Collections.Generic; using UnityEngine; /// /// Скрипт для анимации машины /// public class CarControllerScript : MonoBehaviour { /// /// to do /// [SerializeField] private List _Wheels = new List(); /// /// to do /// [SerializeField] private int _Speed; /// /// высота,чтобы колёса стояли на 0 /// [SerializeField] private float _High; public float High { get => _High; set => _High = value; } private void Start() { _High = gameObject.transform.position.y; } private void FixedUpdate() { foreach (var wheel in _Wheels) { wheel.transform.Rotate(Vector3.right * _Speed); } } }