Lobbing

I am using the following script to “shoot” a bullet.

var shotsound:AudioClip;
var shellPrefab : GameObject;
var proyectilevelocity:int;
var ammo:int;
var fireRate = 1.0;
private var nextfire = 0.0;
function FixedUpdate () {
	if(Input.GetButton("Jump")  Time.time>nextfire  ammo>0)
		ShotProyectile();
}
function ShotProyectile(){
		if(Time.time > nextfire)
		{
	var Grenade:GameObject = Instantiate(shellPrefab,transform.position,transform.rotation);
	Grenade.GetComponentInChildren(Rigidbody).velocity =transform.TransformDirection(Vector3(0,0,proyectilevelocity));
	ammo--;
	if(shotsound)
		audio.PlayOneShot(shotsound);
	Destroy(Grenade,10);
	nextfire = Time.time+fireRate;}
}

This shoots the bullet straight out. How do I change the script to send the bullet out like a 45 deg angle up so it lobs the bullet? I assume transform.rotation needs to change but I don’t know what I need to do.

Can anyone help?

I think I would start changing the second variable in this line:

   Grenade.GetComponentInChildren(Rigidbody).velocity =transform.TransformDirection(Vector3(0,0,proyectilevelocity));

The Vector3 (x,y,z) is a direction. Forward is (0,0,1) and up is (0,1,0) so to make it start to move upwards, try (0, 0.5, proyectilevelocity).

Let me know if that works.

And would a moderator delete the account of that Wow spammer two0426?!

Also, Sydious, look at this page: