Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var splat : GameObject;
- function Update ()
- {
- if (Input.GetMouseButtonDown(0))
- {
- var ray = camera.ScreenPointToRay (Input.mousePosition);
- var hit : RaycastHit;
- if (Physics.Raycast (ray, hit, Mathf.Infinity))
- {
- theSplat = Instantiate (splat, hit.point + (hit.normal * 2.5), Quaternion.identity);
- Destroy (theSplat, 2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement