Advertisement
Guest User

Untitled

a guest
Jan 28th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class laser : MonoBehaviour {
  6.  
  7. Ray myRay = new Ray(new Vector3(-9.352f, -6.34f, 0), new Vector3(-9.59711f, 6.10705f, 0));
  8. RaycastHit hit;
  9.  
  10. // Update is called once per frame
  11. void Update () {
  12. if(Physics.Raycast(myRay, out hit)) {
  13. if(hit.collider.tag == "mirror") {
  14. Debug.Log("I hit something!");
  15. }
  16. }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement