use rotation to determine projectile direction

HI there,
If I have an objects z rotation, can I use that value to send a projectile off in a direction? The direction being a direct reflection of the rotation?

Assuming the instantiation script is on the same object as the one whose rotation you want to use:

var instantiatedProjectile = Instantiate(projectile, transform.position, transform.rotation);
instantiatedProjectile.rigidbody.velocity = (transform.forward * projectileSpeed); //set velocity in the direction of this transform's z axis

or, if not:

var instantiatedProjectile = Instantiate(projectile, objectWhoseRotIWantToMatch.transform.position, objectWhoseRotIWantToMatch.transform.rotation);
instantiatedProjectile.rigidbody.velocity = (objectWhoseRotIWantToMatch.transform.forward * projectileSpeed); //set velocity in the direction of objectWhoseRotIWantToMatch's z axis