Lock Camera after Dialogue Ends

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
HierophantDev
Posts: 3
Joined: Sun Feb 23, 2020 5:31 pm

Lock Camera after Dialogue Ends

Post by HierophantDev »

Hello,
I'm unsure of how to stop my camera zooming out after a conversation ends. I'd like it to stay at the spot it zoomed to so the players can start other conversations that are attached to the zoomed game object.
Thanks.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Lock Camera after Dialogue Ends

Post by Tony Li »

Hi,

Conversations always clean up after themselves by moving the camera back to the original, pre-conversation position.

To achieve what you want to do, I recommend this setup:

1. Assign your main camera -- or a different camera or camera prefab -- to the Dialogue Manager's Camera & Cutscene Setting > Sequencer Camera field. Conversations will make a clone of the camera. For example, if your main camera is named "Camera", then the one used during the conversation will be named "Camera(Clone)". Camera() sequencer commands (or Zoom2D() in 2D) will use the clone.

2. In the last node, move the main camera to the position of the clone using a Sequence like this:

Code: Select all

MoveTo(Camera(Clone), Camera);
{{default}}
(I added {{default}} so it will also play the Dialogue Manager's Default Sequence.)

---

Side note: If you want to smoothly zoom back to the original position before ending the conversation, in the last node use a Sequence like this to zoom back (in 3D scenes) over 2 seconds:

Code: Select all

Camera(original,,2)
However, I believe this is the exact opposite of what you're asking about.
HierophantDev
Posts: 3
Joined: Sun Feb 23, 2020 5:31 pm

Re: Lock Camera after Dialogue Ends

Post by HierophantDev »

Hi Tony,
That worked almost perfectly, with the only issue being that my mouse cursor disappears when the camera moves (it still works, just invisible, and reappears if I hit exit). I suspect this may be a selector issue. Could you advise?
Thanks.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Lock Camera after Dialogue Ends

Post by Tony Li »

Does the mouse cursor disappear only when the camera is moving? Or during the whole conversation?

As a test, try temporarily disabling the Dialogue Manager's Input Device Manager. This will eliminate any point where the Dialogue System may hide the cursor. If it still disappears, it's probably an unrelated script -- perhaps something that's on the camera?

I'm finishing work for the day, but I'll check back first thing in the morning.
HierophantDev
Posts: 3
Joined: Sun Feb 23, 2020 5:31 pm

Re: Lock Camera after Dialogue Ends

Post by HierophantDev »

Hi Tony,
Sorry for the late response. I fixed my error by disabling the "Control Cursor State" in the dialogue manager.
Thanks for your help!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Lock Camera after Dialogue Ends

Post by Tony Li »

Great! Thanks for letting me know.
Post Reply