Cinemachine Zoom
Cinemachine Zoom
I followed the guide in https://www.pixelcrushers.com/phpbb/vie ... 4&start=20 and i was using cinemachine for the dialogues, but how can i make different Zoom in for the dialogues? without cinemachine i would just use for example Zoom2D(speaker, 8, 2) , but what about cinemachine? is there a simple way or should i design some kind of custom script?
Re: Cinemachine Zoom
No need for custom scripting. You can set up one or more vcams and use a [url-https://www.pixelcrushers.com/dialogue_ ... event.html]Cinemachine Priority On Dialogue Event[/url] component on the NPC, or a sequencer commands such as CinemachinePriority() and CinemachineTarget() as described in the first post of the thread you linked.
Re: Cinemachine Zoom
Yes i already understood how to set up the cinemachine with the Dialogue system, but what i wanted to achieve was different zooming with the same cinemachine camera, as you can easily do with the command "Zoom2D(//, //, //)" put in the dialogues where i want to achieve different zooming effects, i think you missed the point of my question
Re: Cinemachine Zoom
You can use CinemachineTarget() and CinemachindPriority() to do that.
Cinemachine by default smoothly moves the camera (blends) over time.
For example, if you want to zoom over time from a wide angle to a closeup, set up two vcams: one that focuses on the target from a wide angle, and another that focuses on the target close up. Use CinemachineTarget() to change both vcams' targets to the subject (e.g., NPC). Then use CinemachinePriority() to cut to the wide angle, and then CinemachinePriority() again to set the closeup vcam's priority higher so it transitions to the closeup.
Cinemachine by default smoothly moves the camera (blends) over time.
For example, if you want to zoom over time from a wide angle to a closeup, set up two vcams: one that focuses on the target from a wide angle, and another that focuses on the target close up. Use CinemachineTarget() to change both vcams' targets to the subject (e.g., NPC). Then use CinemachinePriority() to cut to the wide angle, and then CinemachinePriority() again to set the closeup vcam's priority higher so it transitions to the closeup.
Re: Cinemachine Zoom
Yes but that's what i was trying to avoid,, to set a lot of different cameras just for different zooming , if i use normal cameras with the zoom2d i can just use 1 camera and change the zoom as many times as i want, but if i for example want 5 different types of zoom with the approach you suggested now i have to set 5 different Cinemachines, what i wanted to know was if there was a similiar approach to the zoom2d settings but that operated with the Ortho size of the single cinemachine used , because basically that's the only thing changing between all the other virtual cameras i would have to create using the approach you suggested.
Last edited by Shinos on Mon Mar 06, 2023 9:05 pm, edited 2 times in total.
Re: Cinemachine Zoom
Nothing is built into the Dialogue System for that, but you could write your own sequencer command that changes a vcam's distance over time.
Re: Cinemachine Zoom
That's what i meant to understand with this post and it's also the reason of why i said earlier if i had to make a custom script or command for that,, if so how could i do it? it would be useful to have a command for this to just change the ortho size of a cinemachine virtual camera in the sequence menu, just like the zoom2d does to the regular cameras, it seems pretty inefficent to me to create hundreds of different cameras just for different zoom effect.
Please how could i write my own sequencer command for this?
Re: Cinemachine Zoom
Hi,
I suggest duplicating SequencerCommandCinemachineTarget.cs and renaming it something like SequencerCommandCinemachineZoom.cs. Then change the "void Awake()" method to an "IEnumerator Start()" method so you can run it as a coroutine that changes the vcam's ortho distance instead of its LookAt/Follow properties.
More info: Custom Sequencer Commands
I suggest duplicating SequencerCommandCinemachineTarget.cs and renaming it something like SequencerCommandCinemachineZoom.cs. Then change the "void Awake()" method to an "IEnumerator Start()" method so you can run it as a coroutine that changes the vcam's ortho distance instead of its LookAt/Follow properties.
More info: Custom Sequencer Commands
Re: Cinemachine Zoom
Thank you for helping me but i think i need a little more help , i feel kinda dumb but i i tried to do as you said and i couldn't get it to work, , when you have some spare time could you provide further assistance? why would i use an IEnumerator method here? i think i am missing something in how doing a custom sequencer command works, i tried to watch also your video on youtube but it didn't help for thisTony Li wrote: ↑Mon Mar 06, 2023 9:42 pm Hi,
I suggest duplicating SequencerCommandCinemachineTarget.cs and renaming it something like SequencerCommandCinemachineZoom.cs. Then change the "void Awake()" method to an "IEnumerator Start()" method so you can run it as a coroutine that changes the vcam's ortho distance instead of its LookAt/Follow properties.
More info: Custom Sequencer Commands
Re: Cinemachine Zoom
Here's the CinemachineZoom() sequencer command:
DS_CinemachineZoom_2023-03-07.unitypackage
Syntax:
CinemachineZoom(vcam, zoom, [duration])
DS_CinemachineZoom_2023-03-07.unitypackage
Syntax:
CinemachineZoom(vcam, zoom, [duration])
- vcam: The name of a GameObject containing a CinemachineVirtualCamera.
- zoom: The lens orthograpic size.
- duration: Duration over which to transition to zoom. (Default: 0 [instant])