using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class OverrideLeaningController : MonoBehaviour { private BicycleController bicycleController; private Rigidbody rigidbody; // Start is called before the first frame update void Start() { bicycleController = GetComponent(); rigidbody = GetComponentInChildren(); bicycleController.offsetCollidersFromWheel = 2f; } // Update is called once per frame void Update() { //rigidbody.rotation = Quaternion.AngleAxis(bicycleController.CurrentLeaningAngle, rigidbody.transform.forward); } private void FixedUpdate() { //rigidbody.MoveRotation(Quaternion.AngleAxis(bicycleController.CurrentLeaningAngle, rigidbody.transform.forward)); } }