Advertisement
Munchy2007

Unet5Tut5Pt1RayCast

Feb 24th, 2016
4,590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.21 KB | None | 0 0
  1. Ray ray = new Ray(laser.transform.position,transform.forward);
  2. RaycastHit hit;
  3. if(Physics.Raycast(ray, out hit, 10f))
  4. {
  5.     var hitPlayer = hit.collider.gameObject;
  6.     CmdDoShotSomeone(gameObject, hitPlayer);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement