I have a script attached to my camera that allows me to translate when holding left mouse and rotate when holding left mouse and shift. Translate works as intended until a rotation happens. If the camera is rotated 180 degrees along y, the translation is reversed. How can I make the translation work the same regardless of the cameras rotation. Thanks for any help.
Heres a snippet
if (isMouseMoving == true)
{
if(Input.GetKey("left shift"))
{
transform.eulerAngles += rotateSpeed * new Vector3(0, Input.GetAxis("Mouse X"), 0);
}
else
{
transform.position += dragSpeed * new Vector3(-Input.GetAxis("Mouse X"), 0, -Input.GetAxis("Mouse Y"));
dragOrigin = Input.mousePosition;
}