Page 1 of 1

Zoom2D go and return smoothly

Posted: Fri May 28, 2021 9:36 am
by Deses
Hi! I've set up a Zoom2D that moves from a Capsule Collider to the transform of another GameObject, and that works perfectly.
Then I set a delay for 2 seconds and then the camera returns instantly to the character.

Code: Select all

Zoom2D(listener,5.5,1);
Delay(2);
What I would like to do is to smoothly return the camera to the character just as it went to the point of interest.

Code: Select all

Zoom2D(listener,5.5,1);
Delay(2);
Zoom2D(speaker,5.5,1);
I tried with that code but rather than doing the first camera translation smoothly, it just zooms slightly out, then teleports to the point of interest, waits and comes back.

"Speaker" is the thing I wanna look at and the "Listener" is the object that contains the trigger.

I'm sure I'm missing something super easy but I'm not getting it lol.

The project is using the 3D with a 2D ortographic perspective and cameras.

Re: Zoom2D go and return smoothly

Posted: Fri May 28, 2021 9:56 am
by Tony Li
Hi,

All sequencer commands will run as soon as the sequence starts unless you use the "@" syntax to set its timing. Try changing your sequence to:

Code: Select all

Zoom2D(listener,5.5,1);
Zoom2D(speaker,5.5,1)@2;
This will tell the second command to wait for the 2-second mark to run.

Re: Zoom2D go and return smoothly

Posted: Fri May 28, 2021 11:35 am
by Deses
Yes! That's it! Thanks a ton, Tony!

Re: Zoom2D go and return smoothly

Posted: Fri May 28, 2021 1:18 pm
by Tony Li
Glad to help!

BTW, there's a whole video tutorial series on sequences that you might be interested in watching at some point:

Cutscene Sequence Tutorials