Camera Transition

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

Camera Transition

Post by HaiiroMukuro »

Good day! It's been a while. :D I know that this topic is not new here. But I still don't understand how to use the transition of camera.
This is the character and the collider that will trigger the transition of camera.
Image
When the character hits or enters the collider. The camera will switch to this character.
Image
My question is how will the camera will switch? Thank you for the help :)
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Camera Transition

Post by Tony Li »

Hi,

Do you intend for the camera to switch and start a conversation? If so, use the Camera() command in a dialogue entry node's Sequence field. If this is what you want to do, please let me know. I'll provide more details.

Or do you intend for the camera to switch for the duration of a cutscene sequence? (For example, triggered by a Sequence Trigger.) If so, let me know and I'll provide more details on this.

Or do you want to transition the camera during gameplay? If this is the case, it's not really what the Dialogue System was designed for, but I could probably give you the steps to do it if you'd please describe the requirements more.
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

Re: Camera Transition

Post by HaiiroMukuro »

Yes, I intend the camera to swtich for the duration of a cutscene and also I'm using the sequence trigger.
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Camera Transition

Post by Tony Li »

Hi,

Make sure the Sequence Trigger is set to OnTriggerEnter.

In the Sequence field, use the Camera() command.

For the position, the Camera() command can accept a camera angle name or a specific GameObject.

Here are the default camera angle names: Default Camera Angles

Let's say the character in the second image is named "Boy123". Put this command in the Sequence field to cut immediately to the back of Boy123:

Code: Select all

Camera(Full Back, Boy123)
You can also set a specific, absolute position in the scene. Let's say you create an empty GameObject behind Boy123 called "Cutscene Camera Position". Use this sequence to move the camera to the position of Cutscene Camera Position:

Code: Select all

Camera(Cutscene Camera Position)
Here is a more complex example:

Code: Select all

Fade(out,1);
Camera(Full Back, Boy123)@1;
Fade(in,1)@1;
AnimatorPlay(StandUp, Boy123)@2;
AudioWait(GiveAnswer, Boy123)@3
In this example:

1. [0:00] The screen fades to black over 1 second.

2. [0:01] The camera moves to a Full Back angle of Boy123.

3. [0:01] The screen fades in from black over 1 second.

4. [0:02] Boy123 plays the "StandUp" animator state

5. [0:03] Boy123 plays the audio clip "GiveAnswer".
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

Re: Camera Transition

Post by HaiiroMukuro »

It work thanks :)
I still have a question. How will I make the camera stay for a long period of time on boy123 and switchback the camera using the sequence in the Conversation?
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Camera Transition

Post by Tony Li »

When you move the camera using the Camera() command, it will stay there until the sequence ends. If you want to make the sequence last for a specific amount of time, use the Delay() command. For example:

Code: Select all

Camera(Full Back, Boy123);
Delay(10)
This will move to the camera to a Full Back angle of Boy123. The camera will stay there for 10 seconds.

However, if your gameplay scripts also control the camera, you must temporarily disable them during the sequence. Otherwise the gameplay scripts will move the camera.

There are two ways to temporarily disable the gameplay scripts:

1. Use the SetEnabled() sequencer command:

Code: Select all

SetEnabled(SmoothCameraFollow,false,Player);
SetEnabled(MouseLook,false,Player);
Camera(Full Back, Boy123);
SetEnabled(SmoothCameraFollow,true,Player)@10;
SetEnabled(MouseLook,true,Player)@10
At [0:00], this sequence will find a GameObject named "Player" and disable its SmoothCameraFollow and MouseLook components.
At [0:10], it will re-enable the components.

2. Or add a Set Component Enabled On Dialogue Event component to the Sequence Trigger. Set the Trigger to OnSequence. In the OnStart section, assign the components and set them False. In the OnEnd section, assign the components and set them True.

If a sequence doesn't work the way you expect, temporarily set the Dialogue Manager's Debug Level to Info. This will log activity to the Console window. It should help you determine what each command is doing.
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

Re: Camera Transition

Post by HaiiroMukuro »

So far, I make a lot of camera transitions. Thanks for your help. :)
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Camera Transition

Post by Tony Li »

Happy to help! :D
Post Reply