hello
I’m a beginner who doesn’t have much experience with a cinemachine
I want to make a basic camera like below through a cinemachine
I tried to solve this problem through “FreeLook Camera”
(I don’t know if this is the right approach)
But it had some big differences from what i wanted.
I want to know the appropriate approach or keywords to solve this problem.
It is a simple character camera used in a typical mmorpg, etc.
The camera rotates releative to the obeject according to the movement of the mouse
and can see the object
can Zoom in/out
Even if the object is moved, camera’s gaze is fixed
(follow the target, but direction does net change)
Lower mouse down, eyes get closer to the floor.
continue lower mouse down, camera will be closer to the object and gaze will change.
( https://files.catbox.moe/iq182m.webp )
This is a more detailed description of the conditions 4.
camera moving when the eyes go down.
if return to original gaze, existing zoom in/out distance must be maintained.
I was able to make similar movements through the freelook,
However, i can’t subtly satisfied with the above conditions.
What is name for this type of camera?
What method of approach is appropriate to implement this camera?
Hi
You are on the right track, freelook seems to be a good fit for your needs
In the Freelook vcam inspector: set Orbits → Binding Mode to Lock To Target. This will make the camera stay behind the target.
If you do not want to move the camera around your target with your mouse, instead you’d like to control the target’s rotation directly with your mouse. Then disable the mouse control on the X axis on the freelook.
In the Orbits section, scale the radiuses of TopRig, MiddleRig and BottomRig. For example, if your radiuses are 2, 3, 2, then changing them to 4, 6, 4 will result in a 2x zoom out, and changing them to 1, 1.5, 1 will result in a 2x zoom in.
If I understand correctly, you’d like to turn off damping. You have TopRig, MiddleRig and BottomRig. Turn off the dampings on them. I am not sure which ones you’d like off, so play around with them until you have what you’d like.
This is achieved by having smaller radius for the BottomRig than the MiddleRig. If you have your Freelook camera selected, then you will see a red gizmo drawn in the scene view. This visualizes the rigs of Freelook.
If you need more info or clarification, please reach out
Based on this movement,
This is the image that expresses it like the trajectory of a cinemachine FreeLook
As shown in the attached gif,
distance between the highest and furthest positions is the same
create a circular orbit
From the moment the camera touches the floor,
the camera gets closer to the character and heads up
i tried to reproduce this as cinemachine FreeLook
changed radius of Top, Bottom Rig to 0(or 0.01)
changed radius of MiddleRig and height of TopRig to make a same distance.
But the shape of the curve showed a lot of difference.
In fact, the camera has a problem that goes down through the ground.
To resolve this, i use Spline Curvature option, but it couldn’t solve the problem.
How do i reproduce this camera work?
one of the questions i misinterpreted,
“camera follows without being affected by the character’s movement”
was solved by setting Binding Mode to World Space.
For zoom In/Out, i wrote script.
receive events of mouse wheel and manually change the value of
Top, Middle, Bottom Rig’s Radius and Height.
It’s behavior was not fluid and made me wonder if this was the right way…
is there are any zom in/out function without using custom script?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cinemachine;
using UnityEngine;
namespace Test
{
[RequireComponent(typeof(CinemachineFreeLook))]
class CinemachineFreeLookZoom : MonoBehaviour
{
private CinemachineFreeLook freelook;
private CinemachineFreeLook.Orbit[] originalOrbits;
[Range(0.0F, 1F)]
public float zoomPercent;
public void Awake()
{
freelook = GetComponentInChildren<CinemachineFreeLook>();
originalOrbits = new CinemachineFreeLook.Orbit[freelook.m_Orbits.Length];
for (int i = 0; i < freelook.m_Orbits.Length; i++)
{
originalOrbits[i].m_Height = freelook.m_Orbits[i].m_Height;
originalOrbits[i].m_Radius = freelook.m_Orbits[i].m_Radius;
}
}
public void Update()
{
for (int i = 0; i < freelook.m_Orbits.Length; i++)
{
freelook.m_Orbits[i].m_Height = originalOrbits[i].m_Height * zoomPercent;
freelook.m_Orbits[i].m_Radius = originalOrbits[i].m_Radius * zoomPercent;
}
}
}
}
It is a bit tricky, because your path is not smooth. It has a curve and a line. So I suggest building it in to parts like this:
You can create the curvy part using the rigs (top, middle, bottom), and to get the straight line add a CinemachineCollider (Add Extension → CinemachineCollider) with Pull Camera Forward Strategy.
For example:
If you create the rigs using these settings
then you’ll get the following curve
Notice that the curve goes below the ground. This is the part where the collider is going to do its job pulling the camera towards the player in a straight line.