Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- var hit : RaycastHit;
- var raycastDist : float = 100;
- var Gun : GameObject;
- var PressE : GameObject;
- function Start () {
- PressE.gameObject.SetActive(false);
- }
- function Update () {
- if(Physics.Raycast(transform.position, transform.forward, raycastDist)) {
- if(hit.transform.name == ("Table"))
- PressE.gameObject.SetActive(true);
- else
- PressE.gameObject.SetActive(false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment