Bukyja

Untitled

Sep 22nd, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class CrouchOffTrigger : MonoBehaviour
  6. {
  7.     ControllerPlayer controllerPlayer;
  8.  
  9.    
  10.     private void OnTriggerStay(Collider other)
  11.     {
  12.         if (other.tag == "Player")
  13.         {
  14.  
  15.             controllerPlayer.enabled = !controllerPlayer.enabled;
  16.         }
  17.  
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment