Forum rules - please read before posting.

Force NPC to play idle_sad_standing

Hi,

How would I force a different idle to play on my NPC using Spine animations? I want idle_sad_standing to play instead of idle dependent on a global variable. But with all the methods I have tried it doesn't work. Charcater:animate custom does not force it as it seems to ber dictated by the NPC script.

Unity 2021.3.15f1
AC V1.80.5

Comments

  • You're using the Spine integration on the AC wiki?

    https://adventure-creator.fandom.com/wiki/Spine_Integration

    The Character: Animate Action's "Set Standard" method can be used to change the name of the Idle animation at runtime.

  • Hi, I am getting this error:

    ArgumentException: Animation not found: idle_sad_standing
    Parameter name: animationName
    Spine.AnimationState.SetAnimation (System.Int32 trackIndex, System.String animationName, System.Boolean loop) (at Assets/Spine/Runtime/spine-csharp/AnimationState.cs:676)
    AC.Spine.DirectionMapper.PlayClip (System.String clip, System.Int32 trackIndex, System.Boolean doLoop) (at Assets/Sleepytime Village/Scripts/DirectionMapper.cs:34)
    AC.AnimEngine_Spine.PlayCharAnim (System.String clip, System.Int32 trackIndex, System.Boolean doLoop) (at Assets/Sleepytime Village/Scripts/AnimEngine_Spine.cs:731)
    AC.AnimEngine_Spine.PlayStandardAnim (System.String clip) (at Assets/Sleepytime Village/Scripts/AnimEngine_Spine.cs:712)
    AC.AnimEngine_Spine.PlayIdle () (at Assets/Sleepytime Village/Scripts/AnimEngine_Spine.cs:655)
    AC.Char.AnimUpdate () (at Assets/AdventureCreator/Scripts/Character/Char.cs:1102)
    AC.Char.BaseUpdate () (at Assets/AdventureCreator/Scripts/Character/Char.cs:681)
    AC.NPC._Update () (at Assets/AdventureCreator/Scripts/Character/NPC.cs:117)
    AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:275)
    

    I have an idle, walk and idle_sad_standing anim embedded in the skeleton animation component on the Spine gameobject sprite child, but do i need to force a animation on the NPC parent with transitions/parameters to force the animation to play when setting standard? See screenshots here, thanks:

    https://www.dropbox.com/scl/fo/315ozbvj2qhqycltraww9/APQIO3rVjg6KRlJO9NVUlfo?rlkey=xitynomv3qbht1ftcryiniw1g&st=akjk92gn&dl=0

  • I'm not familiar enough with Spine to answer fully. Does it work if you set the Idle name initialy to idle_sad_standing?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.