I want write a Tower script which can shoot arrow to people,tower dosent need to be rotation,just shoot the arrow to people.
but my arrow dosent follow my player,
could anyone help me ![]()
thanks!
var LookAtTarget : Transform;
var timeDelay = 5;
var ArrowPoint : GameObject;
var Arrow : GameObject;
function Start() {
while (true) {
yield WaitForSeconds(timeDelay);
//The function(The gameObject, THE SPAWNS LOCATION, the spawns direction)
var arrowClone : GameObject = Instantiate( Arrow, ArrowPoint.transform.position, Quaternion.identity );
arrowClone.transform.LookAt(LookAtTarget);
arrowClone.rigidbody.AddForce(transform.forward * 1000);
Destroy ( arrowClone, 15 );
}
}
function Update () {
}
Read this page : http://answers.unity3d.com/page/newuser.html For any help, please format your code. You can do this by highlighting all your code, then clicking the 10101 button at the top of the edit window. Watch : http://video.unity3d.com/video/7720450/tutorials-using-unity-answers
– AlucardJayOops,Im sorry about that and thanks for your remind. I already format my code now(:
– Juhsi