Скрипт касания игрока машиной, переделывание префабов

This commit is contained in:
2024-12-18 16:02:21 +03:00
parent 937a6340ec
commit 2eb77c8dc2
98 changed files with 10112 additions and 2982 deletions

View File

@ -13,9 +13,29 @@ public class CarControllerScript : MonoBehaviour
[SerializeField]
private List<GameObject> _Wheels = new List<GameObject>();
/// <summary>
/// to do
/// </summary>
[SerializeField]
private int _Speed;
/// <summary>
/// высота,чтобы колёса стояли на 0
/// </summary>
[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)
@ -23,4 +43,6 @@ public class CarControllerScript : MonoBehaviour
wheel.transform.Rotate(Vector3.right * _Speed);
}
}
}