Shamba

speed

Mar 16th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.33 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Speed_trigger : MonoBehaviour {
  6.  
  7.     public float newspeed = 1;
  8.     private void OnTriggerEnter(Collider other)
  9.     {
  10.         if(other.gameObject.tag == "Player")
  11.         {
  12.             CubeMovement.speed = newspeed;
  13.         }
  14.     }
  15. }
Add Comment
Please, Sign In to add comment