The code is:
1 var target : Transform
2
3 function Update () {
4 }
5
6 function OnMouseDown () {
7 this.transform.position = target.position;
8 this.transform.parent = GameObject.Find("FPSController").transform;
9 this.transform.parent = GameObject.Find("FirstPersonCharacter").transform;
10 }
11 function OnMouseUp () {
12 this.transform.parent = GameObject.Find("FPSController").transform;
13 this.transform.parent = null;
14 }
any help would be greatly appreciated.
↧