Add animation to camera angle

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fanaei
Posts: 73
Joined: Wed Aug 15, 2018 10:38 am

Add animation to camera angle

Post by fanaei »

Hi Tony,
I wanted to add animation to some camera angles. For example having a shaking effect when NPC says a dialogue with anger. Is it possible? Because I couldn't find any way to add animation to Dialogue camera.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Add animation to camera angle

Post by Tony Li »

Hi,

Are you using the main camera, or have you assigned a camera/prefab to the Dialogue Manager's Sequencer Camera field?

In either case, as long as you know its name, you can use AnimatorPlay, such as:

Code: Select all

AnimatorPlay(SomeEffect, MainCamera)
If you're trying to shake by changing the camera's transform, you may need to write a separate method to do that, or a custom sequencer command, unless the camera is a child of a GameObject that you know is in the correct position. If the camera is a child, you can play the animation on the parent object and change the camera's transform relative to the parent.
Post Reply