• Unity
  • PLAYMAKER Integration

Related Discussions
...
foriero wrote

Thanks Spiral, I will look into Mitch's implementation. In the meantime I did create new action and cleaned a bit the old ones. The new one is called SpineEventConditionAction.cs. Just set your condition on what you want to react and you are good to go.


Please download actions from initial post of this thread.

have a question for you, how to implement a script for Animation Event. For example, in Spine2d on the desired animation, I created an event for example "Wrong" and I want to be sent to SendEvent on detection. I nowhere to find examples related to Spine in Animator. I found one method, but it's a little different, jy defines the end of the animation but it does not work correctly, below I can apply this script can be useful.
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{

[ActionCategory("Artix")]
[Tooltip("Artix Production")]
public class SendEventEndAnimation : FsmStateAction
{

    [RequiredField]
    [CheckForComponent(typeof(UnityEngine.Animator))]
    [Tooltip("The GameObject to be observed.")]
    public FsmOwnerDefault gameObject;

    [RequiredField]
    [Tooltip("Send this event when animation finished.")]
    public FsmEvent sendEvent;

    [RequiredField]
    [Tooltip("The name of the animation to be observed.")]
    public FsmString animationName;

    private Animator animator;

    public override void Reset() {
        gameObject = null;
        sendEvent = null;
        animationName = null;
    }

    // Code that runs on entering the state.
    public override void OnEnter() {
        var go = Fsm.GetOwnerDefaultTarget(gameObject);
        animator = go.GetComponent<Animator>();
    }

    // Code that runs every frame.
    public override void OnUpdate() {
        var a = animator.GetCurrentAnimatorStateInfo(0);
        if (a.IsName(animationName.Value) && a.normalizedTime >= 0.98f) {
            Fsm.Event(sendEvent);
        }
    }
}

}

a year later

Is this thread still alive? I want to use playmaker with Spine, but I don't know if many years later this actions works nowadays.

You can have a look at these forum threads regarding playmaker integration:
PLAYMAKER
Spine - Unity - Playmaker / Quick Tip

15 days later

I think the actions are working. If not let me know. We are still here and using them everyday. :-)

5 months later

Hi.
Here says 'no overload methods for Sa_State_Event corresponds to the delegate AnimationEvent.TrackEntryEventDelegate'

EDIT: There are other 30 errors of the same type spread on the others scripts

It looks as if your Playmaker integration is not compatible with the spine-unity runtime version you are using.
Which Playmaker integration and which version of the spine-unity runtime are you using?