0
votes

I'm trying to set a script that will make a camera in unity act like a camera in a 3d mmo. All the tutorials in youtube/google failed to help me cause they all act the same. This what I need my camera to do:

  1. Rotate around a moving object. the object is the player. the player should not rotate with the camera (cause some script "solve" the problem by rotating the player and this is not an mmo style!)
  2. The camera has to follow the player at all time while the player is always in the center of the screen.
  3. The camera need to rotate on the x,y and not on the z(z is always zero).
  4. The camera should zoom in on the player when the max height is reached and zoom in as well when min height is reached. same with obstacle.
  5. In the width rotation can do 360 degree.
  6. The camera doesn't need to be always at the back (should not return unless I moved my mouse to this position).

Unity cinemachine did not solve my problem cause it is always going orbit to the back of my player and not just following it while orbit. An example of the camera the best example is like GW2 / cube world.(alhpa version)

If someone here can solve my problem I will really appreciate it.

Thank you!

2

2 Answers

1
votes

I suspect cinemachine still has the solution you need.

It sounds like you just need to adjust the binding mode of the camera. If you try world-space for example, the camera will maintain its world-space offset regardless of the direction that the player themselves are pointing.

For the rest of it, you would want to modify the camera's offset position on mouse move.

That particular script (I think) is already available on the Free Look Camera https://docs.unity3d.com/Packages/[email protected]/manual/CinemachineFreeLook.html

So you should be able to get what you want out of the box.

0
votes

Alex C solved it. Changing it to binding world - space did help but i had to also cancel the camera moving forward when collision happens. this solved my camera and now it is perfect.