[Unity-Cinemachine Camera] Detailed explanation of Cinemachine Brain properties

Download Cinemachine in Package Manager

Create a Virtual Camera, and then you will find that there is an additional logo behind the Main Camera, and the properties can no longer be modified.

Because it is bound to CinemachineBrain, it will read the configuration of a virtual camera in the scene and use this configuration to control the behavior of the camera. If you want to modify attributes such as the camera's field of view and position, you must modify it in the virtual camera.

You can define any number of virtual cameras in your scene and switch between them at any time

Cinemachine Brain related properties

Live Camera: You can see the configuration of which virtual camera is being used

Live Blend: refers to the current virtual camera switching process. When switching from virtual camera one to virtual camera two in the game

Show Debug Text: Show Debug text. After checking, you can see attribute one and attribute two in the Game window, which are the currently used camera and the virtual camera being converted.

Show Camera Frustum: Displays the current frustum, which is the visual range of the camera.

lgnore Time Scale: Indicates whether the camera's behavior is affected by the time scale value

World Up Override: The camera will have an upward concept when moving the lens. The default upper position refers to the "up" in the world coordinate system, which is the direction of the y-axis in the world coordinate system. If the angle between the y-axis of the camera's local coordinate system and the y-axis of the world coordinate system is greater than 90 degrees, the camera will reset its direction so that the angle between the local y-axis and the axis pointing "up" The angle is less than 90 degrees (this problem often occurs in top-down games). If we don't need this reset method, we can place a game object and use the y-axis of this game object to replace the default "above" of the camera. That is, the y-axis of the game object replaces the y-axis in the world coordinate system.

Update Method: refers to what the behavior of the virtual camera is synchronized with

  • Fixed Update: is synchronized with the physics engine

  • Late Update: It is synchronized with the screen drawing

  • Smart Update: Unity will help us choose how to synchronize based on the actual situation.

  • Manual Update: It is the synchronization time that we write our own code to control the behavior of the camera.

Blend Update Method: Refers to what the switching behavior between two virtual cameras is synchronized with.

  • Fixed Update: It is the update time that can be set in the engine. The default is 0.02 seconds.

  • LateUpdate: It is the frame that is executed sequentially after all updates of the current frame of the physics engine are completed. Generally, the displacement of the camera is placed here.

Default Blend: The default camera switching mode, the following s is the camera switching time

  • Cut: Instant switching, that is, two cameras switch in an instant, without transition.

  • Ease In Out: Slowly speed up and cut out from one camera, and slowly decelerate and cut in to another camera.

  • Ease In: Cut out at a constant speed, slow down and cut in slowly

  • Ease Out: Slowly accelerate the cut out and cut in at a constant speed

  • Hard In: Accelerate cut-in

  • Hard Out: rapid acceleration cut-out

  • linear: switching at a constant speed throughout the process

  • Custom: Customize the cut-in and cut-out curves

Custom Blends: Create a resource file in which different switching modes can be customized for different cameras.

Example: From ANY CAMERA to Top Down Cam, the switching style is uniform cut-out, slow deceleration cut-in, and the smoothing event is 2s.

Events: Some events of the camera are triggered

1. Cut Event: A cut occurs between cameras, which is an event that is triggered when switching instantaneously.

2. Activated Event: The switching between cameras is not an instantaneous cut, so the event is triggered at the first frame of the switching.

Guess you like

Origin blog.csdn.net/weixin_60154963/article/details/132593586