LegitTeddyBears

PickupRotate

Jun 22nd, 2017
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class PickupRotate : MonoBehaviour
  6. {
  7.  
  8.     void OnTriggerEnter(Collider collider)
  9.     {
  10.         if (collider.gameObject.name == "Ship")
  11.             gameObject.SetActive(false);
  12.     }
  13.     void Update()
  14.     {
  15.         transform.Rotate(new Vector3(0, -90, 0) * Time.deltaTime);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment