Rotate camera with mouse input depending on base rotation of player (3D)
Well... I struggle for quite a long time now with this. To put it simply, i'd like to obtain the same behavior as the FreeLookCam script contained in the Standard Assets of Unity, but whatever the rotation of the character is. Basically, i'd like the camera to rotate around the up vector of the player depending on mouse "x" input.
That can be done quite simply by making the camera a child of the character, but I don't want the rotation of the camera to be affected by the right and forward axis of the player.
I'd like to have something like that :
In any and every case in the 3D world. I sure hope to find someone that is a better mathematician than me. :P
Answer by streeetwalker · Apr 12, 2020 at 09:12 AM
Look at the documentation on Transform.RotateAround. It will do what you want.
Your answer

Follow this Question
Related Questions
Rotate Object Axis On Swipe Cam Rotation - Android 1 Answer
My camera rotate but my player dont. How Ive to do so? 1 Answer
Top Down Game - Camera Follow Player and General Scripting Question 0 Answers
Making camera move with right click and drag 3 Answers
[2D]Hybrid cursor and mouse following camera trouble [Resolved] 1 Answer