OverrideLeaningController.cs 857 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class OverrideLeaningController : MonoBehaviour
  6. {
  7. private BicycleController bicycleController;
  8. private Rigidbody rigidbody;
  9. // Start is called before the first frame update
  10. void Start()
  11. {
  12. bicycleController = GetComponent<BicycleController>();
  13. rigidbody = GetComponentInChildren<Rigidbody>();
  14. bicycleController.offsetCollidersFromWheel = 2f;
  15. }
  16. // Update is called once per frame
  17. void Update()
  18. {
  19. //rigidbody.rotation = Quaternion.AngleAxis(bicycleController.CurrentLeaningAngle, rigidbody.transform.forward);
  20. }
  21. private void FixedUpdate()
  22. {
  23. //rigidbody.MoveRotation(Quaternion.AngleAxis(bicycleController.CurrentLeaningAngle, rigidbody.transform.forward));
  24. }
  25. }