I was wondering how cinemachine needs to be setup to recreate a fly camera that won’t go through objects
and also an orbit follow cam, with mouse control for orbit and WASD for offset
also, how can i get the camera up to match the target up? with some dampening, think top gun follow cam
cheers
Could you elaborate? Do you mean something like the CinemachineCollider?
Orbital Transposer is using the built-in input mouse by default. It also support the Input System via Cinemachine Input Provider.
To control the offset with WASD, you need to get CinemachineOrbitalTransposer and then set the follow offset based on your preferences:
var orbitalTransposer = GetComponent<CinemachineOrbitalTransposer>();
orbitalTransposer.m_FollowOffset = new Vector3(x, y, z);
Could you show a movie clip with this behaviour? I have not seen the movie.
Looks close to what i need but this one only has rotation in the horizontal plane and i need vertical also.
can’t find the shot i’m thinking of: camera following behind the jet, jet’s rolling left and right and the camera is trying to match the roll but with a delay.
no idea what those are, just that the camera needs to avoid penetrating ground and ground is runtime generated so can’t go about placing hints.
And in term of motion of the fly camera: simple pan tilt controlled by mouse delta position and roll controlled by scrollwheel or keys, pan tilt always in local space of the camera so if you are rolled at 90 degrees from world up pan and tilt still act properly as pan and tilt on the screen
You can try the following example, and then you can fine-tune it further:
- Create a Cinemachine Virtual Camera.
- Set your Follow and Look At target to the jet.
- Set Body to Transposer.
- Set Follow Offset to your liking.
- Set the Binding Mode to Lock To Target.
- Set X, Y, Z Damping to 0.
- Set Angular Damping Mode to Quaternion.
- Set Angular Damping to 2 (or other value).
- Set Aim to Hard Look At (you can change it to something more fancy if you’d like).
You can also have a look at our sample scene: FollowCam. This is a setup that follows a plane flying along a spline path.
Let me know if this helps
I see you opened other threads for the collider question: https://forum.unity.com/posts/8506985/ , and orbital transposer - freelook: https://forum.unity.com/posts/8506874/ , https://forum.unity.com/posts/8506829/ .
Briefly, you probably want to have 2 vcams. Transposer vcam and Freelook vcam. When you want to be able to orbit around the jet, you are going to active Freelook vcam. When you just want to follow the plane with damped rotation, you are going to active the Transposer vcam.
Let us know if there is a question unanswered here, and we’ll get back to you