cars
This commit is contained in:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user