Hey guys, I'm trying to put together a Geometry Wars like clone just to become familiar with Unity. Currently I have an orthographic camera set up facing into the positive Z axis. I also have a cube, which is the player, moving around the screen and always rotating to face the mouse position.
Now, I've been trying to instantiate a bullet prefab in front of the player with a movement direction in the same direction the player is facing at the point of the instantiation. I've tried to simply Instantiate the prefab using...
Instantiate(bullet, transform.TransformPoint(transform.forward * 20, transform.rotation);
But Unfortunately, no matter how my cube is rotated transform.forward is always (0,0,1). And since my camera is orthogonal and facing into the positive Z axis, the bullet just appears right at the player position.
I have similar problems moving the actual bullet in the direction the player was facing at the time of instantiation. Doing...
transform.Translate( transform.forward * bulletSpeed * Time.deltaTime );
Has no effect either since transform.forward is (0,0,1) here as well.
So my question is, what should I be doing in order to get transform.forward to properly reflect the ships rotation. Or should I be using something else entirely?
Thanks!