Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. var splat : GameObject;
  2.  
  3. function Update ()
  4. {
  5. if (Input.GetMouseButtonDown(0))
  6. {
  7. var ray = camera.ScreenPointToRay (Input.mousePosition);
  8. var hit : RaycastHit;
  9.  
  10. if (Physics.Raycast (ray, hit, Mathf.Infinity))
  11. {
  12. theSplat = Instantiate (splat, hit.point + (hit.normal * 2.5), Quaternion.identity);
  13. Destroy (theSplat, 2);
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement