Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class GetOutOurCar : MonoBehaviour {
- public GameObject WheelCamera;
- public GameObject BrakeMe;
- public GameObject driver;
- public GameObject OurCar;
- public GameObject DoorAnimation;
- private bool activate;
- Animator animator;
- void Start ()
- {
- animator = WheelCamera.GetComponent<Animator> ();
- }
- void OnTriggerEnter(Collider other)
- {
- if (!activate) //&& (other.tag == "Player")
- {
- BrakeMe.SetActive(false);
- driver.SetActive(false);
- OurCar.GetComponent<RCC_AICarController>().enabled = false;
- OurCar.GetComponent<Rigidbody>().useGravity = false;
- OurCar.GetComponent<Rigidbody>().isKinematic = true;
- WheelCameraGetOutController("GetOut");
- DoorAnimation.GetComponent<Animator>().enabled = true;
- activate = true;
- }
- }
- void WheelCameraGetOutController(string direction) //Animator function.
- {
- animator.SetTrigger(direction);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement