Page 1 of 1

Add animation to camera angle

Posted: Mon Sep 30, 2019 12:44 pm
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.

Re: Add animation to camera angle

Posted: Mon Sep 30, 2019 1:38 pm
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.