Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class SupportDriveScript : MonoBehaviour
- {
- Rigidbody rb;
- float lastTimeChecked;
- public float antiRoll = 5000.0f;
- void Start()
- {
- rb = GetComponent<Rigidbody>();
- }
- void Update()
- {
- if (transform.up.y > 0.5f || rb.linearVelocity.magnitude > 1f)
- {
- lastTimeChecked = Time.time;
- }
- if (Time.time > lastTimeChecked + 3f)
- {
- TurnBackCar();
- }
- }
- void TurnBackCar()
- {
- transform.position += Vector3.up;
- transform.rotation = Quaternion.LookRotation(transform.forward);
- }
- void HoldWheelOnGround(WheelCollider[] wheels)
- {
- WheelHit hit;
- float leftRiding = 1.0f;
- float rightRiding = 1.0f;
- bool groundedL = wheels[0].GetGroundHit(out hit);
- if (groundedL)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement