forward position of object ignoring rotation

Hey all,

been working on a first person game for fun, this is my first time dabbling in the FPS genre.

Anyway, I threw the standard asset first person character into my scene, and tried to attach a projectile launcher to the camera.

My reasoning is that the projectile launcher gameobject will follow the rotation of the camera, and projectiles will always spawn in the direction of the camera. This is how it used to work for me, anyway.

I tried doing that now, and instead I get a strange behavior. Items attached to the camera appear to rotate correctly, but their XYZ positions do not change to match the camera. They always point the same way no matter what.

I attached a quad to the camera to show this:

Any idea? I haven’t seen this before.

What I’m reading is that you have a GameObject that is a child of the Camera. The gameobject appears to move and rotate correctly as the camera moves throughout the scene. However, when you look at the gameobject’s Transform component inside of the inspector, you don’t see any values changing.

This is expected behavior. The values that you see in the inspector of the Transform component are the local values of the selected gameobject. The values are relative to its parent.

Newly instantiated prefabs don’t inherit position or rotation from anything but their prefab definition. Just create your projectile and set its transform.forward equal to your projectile launcher’s transform.forward.

I think he’s just talking about the gizmo in the scene view. That’s simply cause he has it set to global instead of local.

simply toggle the Transform Gizmo Toggle on the toolbar from Global to Local