CarController.cs 398 B

123456789101112131415161718192021222324
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class CarController : MonoBehaviour
  5. {
  6. public Wheel[] wheels;
  7. public Rigidbody rb;
  8. void Awake(){
  9. foreach(Wheel wheel in wheels){
  10. wheel.myCar= this;
  11. }
  12. }
  13. void Start()
  14. {
  15. }
  16. // Update is called once per frame
  17. void FixedUpdate()
  18. {
  19. }
  20. }