CarController.cs 402 B

12345678910111213141516171819202122232425
  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 Update()
  18. {
  19. }
  20. }