This commit is contained in:
magn9775
2024-04-11 13:22:39 +02:00
parent eeb46585e7
commit 9c64b14b0b
12 changed files with 1657 additions and 295 deletions

View File

@@ -13,12 +13,16 @@ public class carcontrolv2 : MonoBehaviour
public float autoBrake;
WheelControl[] wheels;
Rigidbody rigidBody;
public Rigidbody rigidBody;
// Start is called before the first frame update
void Start()
{
rigidBody = GetComponent<Rigidbody>();
if (rigidBody == null)
{
rigidBody = GetComponent<Rigidbody> ();
}
// Find all child GameObjects that have the WheelControl script attached
wheels = GetComponentsInChildren<WheelControl>();