- Home /
TPS Rotation Camera (similar to WoW or any other mmo)
Hello there, well i am currently programming a third person viewed social game and i somehow cant get my camera to do what it should do!
i want it to be controlled by mouse Y axis moves it should rotate around the character up and down, left and side for the X mouse axis... similar to pretty much any mmo for example World of Warcraft (just the camera)
ive used the rotatearound command to let it rotate which worked fine for the X mouse movement it rotates perfectly aroudn the character but the Y just doesnt want to work... it only rotates if im looking at the back or at the front of the character...
actually i thought of an idea of how i could get it to work but unfortunaly it didnt work that way... heres my code so far
cameraTransform.RotateAround(_target.position, Vector3.forward, Input.GetAxis("Mouse Y")*Ymousesensitivity*((180-cameraTransform.eulerAngles.y)/90));
cameraTransform.RotateAround(_target.position, Vector3.right, Input.GetAxis("Mouse Y")*Ymousesensitivity*((90-cameraTransform.eulerAngles.y)/90));
cameraTransform.RotateAround(_target.position, Vector3.up, Input.GetAxis("Mouse X")*(Xmousesensitivity*0.75));
cameraTransform.eulerAngles.z = 0;
cameraTransform.LookAt(_target);
Your answer
Follow this Question
Related Questions
Player making a 360° looping, camera not following 0 Answers
easing camera rotation after mouse up? 0 Answers
Rotate objects face to camera 1 Answer
Rotating Camera around player object 0 Answers
Mouse control rotate around player 0 Answers