Hey, @gamingislove a year or two ago you set up a demo for me, including the player prefab. I'm having trouble creating new animation states for the player prefab, since any new clips that I create will not play, and when I check on them, it always states that the sprites are missing:

image

I've double checked and the sprites are not missing. When I set the clip up, the sprites all seem to be in order. But upon running the game, the animation will not work, and when I return to the animation clip, it states that the sprites are missing.

I've noticed that the setup includes the player prefab's sprite being a child object, and I'm wondering if this is causing the issue? Here is the player prefab setup:

image

image

Any ideas on what could be causing this problem? Any advice would be appreciated!
Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • Hm, did you get any errors or warnings in the Unity console while creating/saving your animation? Sounds like some issue didn't save the used sprites or something like this.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited January 2
    I didn't get any console errors during the setup of the animation. However, once I enter testplaying, the error shows up in the animator. One thing I have noticed is that after setting the clip up, it shows as follows:

    image

    It lists the new clip (which eventually doesn't work) as Riker_Field: Sprite, since the animator is on the parent object of Riker_Field. However, the rest of the clips show up as Sprite: Sprite, under the child object of Riker_Field

    image

    Could this possibly be what's causing the issue? For whatever reason, no matter what I do, when I try keeping the Sprite child object selected, it still creates the clip as Riker_Field: Sprite instead of Sprite: Sprite.

    I want to say I should just stick the sprite renderer and animator together onto the parent prefab, but I'm not sure how much that would interfere with any preexisting schematics that might have used the child object of Sprite.
    Post edited by LostForest on
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • It's worth noting also, this only occurs on objects that have the sprite set as a child. I've never had any issues with clips on objects that keep the sprite and animator on the parent object.
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • edited January 3
    I can confirm the issue is something to do with having the sprite set as a child, after playing around with things for a bit, but I cannot figure out how to change the player prefab to work/animate properly with all the sprite components on the parent. It seems like it won't forward any of the rotation parameters like this.

    image

    The sprite remains stuck and doesn't rotate properly.

    image

    I wouldn't think I need to change anything in the blend tree or animator to have it work on the parent prefab, would I?

    Post edited by LostForest on
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • I'm also running into this same problem on battle combatant sprites as well. When trying to change them to simply use the sprite on the root/parent, it doesn't animate properly.
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • @gamingislove Is it alright if I send you a copy of my project so you can take a look? It might be easier to just use the animator and sprite renderer on the root object of the combatant prefabs, but I cannot get the player prefab to animate correctly in the field, nor enemies to animate properly in battle.
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • Yeah, might be easier if you send me a test project.

    Generally, changing sprites on child objects via animations shouldn't be a problem. The setup with sprites on child object (not sure if I also set up the animator on the child or on the root in your project) was used to have the parent/root object's rotation be responsible for the movement direction and being able to forward that information to the animator controller, i.e. to play the correct directional animations.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ah okay. If it's some other weird bug, then I don't have a problem keeping the sprites as the child, if we can solve why it's happening.

    I'll send you a copy of the project so you can take a look at it.
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
Sign In or Register to comment.