• RuntimesUnity
  • Enabling elements for specific animations (Unity)

Hello everyone, first time posting!

I'm having this issue where I want some sprites to be drawn (and animated) under specific circumstances, so I have structured the animations as follows:

-Character movement (Idle as far)
-Effects (Specific sprites to be shown when called ("confused stars", "smoke"...)

I want to play movement animations in track 0 and combine those animations with the effects being played in track 1.

If I do this with shown elements there is no problem, the issue comes when I want elements to be enabled only when they have to be shown.

At this point I have tried many things:

-Keying slots in both animations (idle animation: effect disabled, effect animation : effect enabled)
-Keying skins placeholders the same way.

Please, could anyone help me with this issue?

Thanks in advance!

  • Harald ha risposto a questo messaggio
    Related Discussions
    ...

    Hi and welcome to Spine! 😎

    Yimec If I do this with shown elements there is no problem, the issue comes when I want elements to be enabled only when they have to be shown.

    Could you please describe what problem you encountered?

    • Yimec ha risposto a questo messaggio

      Harald

      The problem is no "effect element" is shown at all.

      For instance, I have this structure:

      While the animation played (Track 0) is idle, the skin placeholder should be "Disabled" in both cases.
      Once the animation "Ducks" (Track 1) is active, the placeholder changes to Enabled, which should make visible the "Ducks" mesh, however, it doesn't.

      Edit:
      What I want to say, is that this works properly in Spine, however in Unity it doesn't.

      Have you set a skin at runtime? If there is no skin, the placeholders will be empty.

      Note you don't need an empty placeholder to show no attachment.

      • Yimec ha risposto a questo messaggio

        Nate

        Have you set a skin at runtime? If there is no skin, the placeholders will be empty.

        That solved the problem so far!!

        As I'm new with spine I miss out these kind of things... Thank you very much!

        • Nate ha messo mi piace.

        Great!

        Be sure to get a good understanding of skins and how to best organize before doing lots of work. You probably don't want to have "enabled" and "disabled" placeholders. A placeholder without a skin will show nothing, as you've found. A skin does not need to have an attachment for every placeholder. You can just leave the placeholder empty in skins you don't want something shown there. Even if a skin has a placeholder, you can hide a placeholder just like any other attachment by using the paperclip 📎 icons.