Method SetCameraOverride
SetCameraOverride(int, int, ICinemachineCamera, ICinemachineCamera, float, float)
Override the current camera and current blend. This setting will trump any in-game logic that sets virtual camera priorities and Enabled states. This is the main API for the timeline.
Declaration
int SetCameraOverride(int overrideId, int priority, ICinemachineCamera camA, ICinemachineCamera camB, float weightB, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
int | overrideId | Id to represent a specific client. An internal stack is maintained, with the most recent non-empty override taking precedence. This id must be > 0. If you pass -1, a new id will be created, and returned. Use that id for subsequent calls. Don't forget to call ReleaseCameraOverride after all overriding is finished, to free the OverrideStack resources. |
int | priority | The priority to assign to the override. Higher priorities take precedence over lower ones. This is not connected to the Priority field in the individual CinemachineCameras, but the function is analogous. |
ICinemachineCamera | camA | The camera to set, corresponding to weight=0. |
ICinemachineCamera | camB | The camera to set, corresponding to weight=1. |
float | weightB | The blend weight. 0=camA, 1=camB. |
float | deltaTime | Override for deltaTime. Should be Time.FixedDelta for time-based calculations to be included, -1 otherwise. |
Returns
Type | Description |
---|---|
int | The override ID. Don't forget to call ReleaseCameraOverride after all overriding is finished, to free the OverrideStack resources. |