You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

35 lines
714 B

using UnityEngine;
using System.Collections;
public class MagnetEffect : MonoBehaviour {
public GameObject magnetTipObject; // Object for placing Magnet Ray
// SELF-NOTE: You will need to connect this script to the player controls
// in order to make use of the ShootRay() function.
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
// FUNCTION: Shoot Magnet Ray
void ShootRay(){
RaycastHit hit;
if(Physics.Raycast(magnetTipObject.transform.position, magnetTipObject.transform.forward, out hit)){
if(hit.collider.tag == "moveable"){
print ("Magnet Laser hit the object : " + hit.collider.gameObject.name);
}
}
}
}