I credit the answerer in my game. this is killing me. i have tried a TON of solutions.
This is all in First person. I have a ball on the ground with rigidbody. When the Fire2(v) is press the ball moves to a player then locks if in place until the Fire1(b) is pressed. This is where im having trouble. i want it to launch the ball with a variable amount force in the direction I’m facing but only about 10 to 15 feet forward in the air. I have try so much im gonna start from scratch based off of your suggestions.
var Ball : Transform; var BallHolder : Transform; var launchAt : Transform; private var throwForce : float = 10.0; var smooth : float = 5.0; var ballGrabbed = false; var shoot : GameObject; function Update() { if(!ballGrabbed) { if(Input.GetButton("GetCharge")) { Ball.transform.position = Vector3.Lerp(Ball.position, BallHolder.position, Time.deltaTime * smooth); } } if(ballGrabbed) { Ball.transform.position = BallHolder.transform.position; } if(ballGrabbed) { Ball.transform.LookAt(launchAt.transform.position); if(Input.GetButton("LaunchBall")) { ballGrabbed = false; // ---> THIS IS WHERE I NEED HELP TO THROW THE BALL WITH SOME KINDA OF ADDfORCE } } }