How to throw objects/grenades in looking height?


I created a simple grenade throwing script, which that instantiates the grenade and the I throw it using:

grenadeClone.velocity = transform.TransformDirection(new Vector3(0,0,throwSpeed));

Everything is working, but how can I throw my greande in the camera angle/ looking height?

Thank you!

I assume you are trying to clone the grenades in front of the camera? Make your spawn point a child of the camera at the right position with the forward of the spawn point matching the forward of the camera. Change your throwing code to:

  grenadeClone.velocity = transform.forward * throwSpeed;