Page 1 of 1

Animated sprite error.

Posted: Fri May 05, 2023 11:31 pm
by MythicBean
I tried to follow the video and manual for setting up animated sprites, but I've had some trouble with getting animations to play. There is an animator component on the portrait image panel, the animator controller does show up when the dialogue is triggered, I animated the portrait as a canvas image, but the animations won't play. the animator shows that it is missing the image to animate and I am confused as I didn't see anything about how that part works or how to make sure it uses it's own image. I don't remember if anything specified this, but do I need to use the portrait image's animator component to animate the different sprites or should I use the actor to animate the portrait sprites?

Re: Animated sprite error.

Posted: Sat May 06, 2023 8:02 am
by Tony Li
Hi,

Animate the property named "Portrait Image", or name your Portrait Image GameObject to "Image". Either way will get the name in the animation to match the name in your dialogue UI. If you want to rename the property named in the animation, you can rebuild your animation or use the open source Unity Animation Hierarchy Editor tool explained here.

Re: Animated sprite error.

Posted: Sat May 06, 2023 12:58 pm
by MythicBean
I already tried naming the portrait image to just "Image" before but I did it again just to make sure.
I still get the same problem. Should I be using the portrait image's animator component for all NPC animations? I didn't see if that was specified anywhere.

Re: Animated sprite error.

Posted: Sat May 06, 2023 1:35 pm
by Tony Li
Hi,

Does your Image GameObject have an Image component?

The Image GameObject should have an Animator component. However, the Dialogue System will assign a different animator controller asset to the Animator component for each actor. Add a Dialogue Actor component to the actor's GameObject, and assign the actor's portrait animator controller (i.e., the one that animates the Image component's Sprite).

Re: Animated sprite error.

Posted: Sat May 06, 2023 1:45 pm
by MythicBean
I'm so dumb. I was animating a separate child object instead of the object with the animator component. It's all working good now. Thank you for your help.

Re: Animated sprite error.

Posted: Sat May 06, 2023 1:56 pm
by Tony Li
Happy to help! Glad it's working now.