Transform Direction situation

Hi all!

I have the current situation where I do a similiar job as of MouseOrbit but using iPad´s touches to rotate the camera. There is also a script where the object controlled by the player always receives forces (with AddForce) relative to camera´s TransformDirection.

This is my solution but it is also my problem. When the camera is rotated in a descending/ascending angle, any movement of that other object is slowed down because it´s trying to go downward. Also, in the same angle, if the player moves back, the object receives force to go up.

Limiting the camera rotation on z axis would reduce the effect of this problem, but it would still happens.

Any ideas?


Normalize the force direction to be aligned with the ground, not the camera. If you show the line where you add force and describe how the camera relates, I can probably explain that more precisely.