Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class laser : MonoBehaviour {
- Ray myRay = new Ray(new Vector3(-9.352f, -6.34f, 0), new Vector3(-9.59711f, 6.10705f, 0));
- RaycastHit hit;
- // Update is called once per frame
- void Update () {
- if(Physics.Raycast(myRay, out hit)) {
- if(hit.collider.tag == "mirror") {
- Debug.Log("I hit something!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement