Advertisement
Guest User

Untitled

a guest
Oct 6th, 2022
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class platform : MonoBehaviour
  6. {
  7.     Collider BoxCollider;
  8.     Animator ani;
  9.     // Start is called before the first frame update
  10.     void Start()
  11.     {ani = gameObject.GetComponent<Animator>();
  12.        
  13.     }
  14.  
  15.     // Update is called once per frame
  16.     void Update()
  17.     {
  18.         BoxCollider = GetComponent<Collider>();
  19.     if (ani.SetBool ("Platform", false));
  20.     {
  21.     BoxCollider.isTrigger = true;
  22.     }
  23.     if (ani.SetBool ("Platform", true));
  24.     {
  25.         BoxCollider.isTrigger = false;
  26.     }
  27.     }
  28.    
  29.        
  30.    
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement