lobbing to certain position

im still blur how to solve this one..

im using this code for lobbing the grenade.. but this code need to adjust y to get more distance.

var instantiatedProjectile : Rigidbody = Instantiate( projectile, transform.position, transform.rotation ); instantiatedProjectile.velocity = transform.TransformDirection( Vector3( 0, 15, speed ) ); Physics.IgnoreCollision( instantiatedProjectile. collider, transform.root.collider );

what i want to do is throw the grenade in specific position.

i hope somebody can help me..

Well, you transform the direction of the velocity in Vector3(0, 15, speed). This is the speed in x, y, z. So to change the speed in which it is thrown in the y-direction change the 15 to something higher. Or, even better, at the top of your script type var height = 15.0; amd where the 15 stands type height. Now you can change the height without going into the script. :)

i also found this code that shown what i want, but i need somebody help me.

cTime += 0.01f;

      Vector3 currentPos = Vector3.Lerp(startPos, endPos, cTime);

            currentPos.y += trajectoryHeight * Mathf.Sin(Mathf.Clamp01(cTime) * Mathf.PI);

            transform.position = currentPos;

if i use this code, the physic is not working. if i throw the object to the wall, then the object will go through the wall. i have add rigidbody, but also not working, because i think the object force to go to the position that i have set before.