Zoom2D go and return smoothly

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Deses
Posts: 15
Joined: Fri May 28, 2021 9:27 am

Zoom2D go and return smoothly

Post 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.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Zoom2D go and return smoothly

Post 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.
Deses
Posts: 15
Joined: Fri May 28, 2021 9:27 am

Re: Zoom2D go and return smoothly

Post by Deses »

Yes! That's it! Thanks a ton, Tony!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Zoom2D go and return smoothly

Post 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
Post Reply