Hey please some one help me I am using this two script of throwing my ball. This scripting is automatically throwing my ball, but is can throw ball only once I want to throw my ball at least 4 5 times through the same place. how can i do this?
I got the script from this video “Unity-How to have Character Throw an Object - YouTube”
#pragma strict
var parentbone:GameObject;
var rigid:Rigidbody;
var lastPos:Vector3;
var curVel:Vector3;
function Start () {
transform.parent= parentbone.transform;
rigid.useGravity =false;
}
function Update () {
}
function ReleaseMe()
{
transform.parent=null;
rigid.useGravity=true;
//transform.rotation=parentbone.transform.rotation;
rigid.AddForce(transform.forward*7000);
// parentbone = GameObject.Instantiate (parentbone, transform.position + (transform.forward *2), transform.rotation) as GameObject;
}
#pragma strict
var theball:GameObject;
function ThrowBall()
{
var ballscript:BallScript = theball.GetComponent("BallScript");
ballscript.ReleaseMe();
}