I have a GameObject hierarchy setup like this:
Now the physics part of the player is not a character controller, but a rigid body (because I require more than just the y axis of rotation). When I press 'w', the game should add a force to the rigidbody so that it moves towards wherever its forward is (it is a relative force of Vector3.forward).
The Physics is rotated along its y axis using mouse input, and the camera is rotated along its x axis also using mouse input.
My problem is, when the camera is looking down, the added force is very low, and when the camera looks up, the added force is very high. When I detach the camera from the hierarchy the force application behaves fine, so why does the camera being a child affect the parent rigidbody?
If I need to give any clarification, let me know - it was kind of hard to explain.
Here is my physics code:
I'd guess we'd need to see the code for the physics - but as a guess without it - your 1stPersonGun has a collider attached to it. In which case the collider acts as a part of the parent rigidbody's physical structure and will alter the forces applied to it significantly. This would explain why different angles affected the force differently as the gun is changing its position as the camera moves and hence altering the shape of the object onto which you are applying physics.
Do one of these:
EDIT The final solution to this was to make sure that physics code refers to the transform.forward of the actual item with the rigidbody.