Animated sprite error.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
MythicBean
Posts: 9
Joined: Fri Apr 21, 2023 4:11 pm

Animated sprite error.

Post 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?
Attachments
Screenshot 2023-05-05 222115.png
Screenshot 2023-05-05 222115.png (135.83 KiB) Viewed 276 times
Screenshot 2023-05-05 221944.png
Screenshot 2023-05-05 221944.png (70.57 KiB) Viewed 276 times
Screenshot 2023-05-05 221851.png
Screenshot 2023-05-05 221851.png (49.17 KiB) Viewed 276 times
Screenshot 2023-05-05 145352.png
Screenshot 2023-05-05 145352.png (23.1 KiB) Viewed 276 times
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animated sprite error.

Post 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.
MythicBean
Posts: 9
Joined: Fri Apr 21, 2023 4:11 pm

Re: Animated sprite error.

Post 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.
Attachments
Screenshot 2023-05-06 115447.png
Screenshot 2023-05-06 115447.png (66.77 KiB) Viewed 266 times
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animated sprite error.

Post 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).
MythicBean
Posts: 9
Joined: Fri Apr 21, 2023 4:11 pm

Re: Animated sprite error.

Post 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.
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animated sprite error.

Post by Tony Li »

Happy to help! Glad it's working now.
Post Reply