NicolaSirago

Hi everyone,
first of all thanks for this useful forum, it's plenty of suggestion even for a noob like me :)
I'm writing because I'm really new to Unity and I'm still figuring out how to make working the simplest things.

The first question is:

I have this SkeletonAnimator component and I'd like to handle the events set up by the animator in the spine editor.
I would like to avoid to set the function inside the Animation panel in the way the Unity guide suggests.
Instead, I would like to use the callback method mentioned here:

https://docs.unity3d.com/ScriptReference/AnimationEvent.html

using the HandleEvent set in the animation state event.

my problem is that I have a SkeletonAnimator and not a SkeletonAnimation

do you know how to access the animation states from the SkeletonAnimator? or do you know how any way to listen to events without writing things in the animation panel?

thanks in advance for any suggestion!

Nic.
NicolaSirago
Posts: 6

Pharan

SkeletonAnimator assumes you do things the Unity Animator way. So you get them as messages from the Animator.
If your event is named "Hit", any method named Hit on a component on the same GameObject will be called by Unity through its SendMessage system.
This is as that page describes.
User avatar
Pharan

Pharan
Posts: 5220


Return to Unity