How to detect an animation has completed? Also is there a more complete scripting documentation anywhere?

Discuss issues pertaining to the various game/web runtimes of Creature here.
Post Reply
GenzDev
Posts: 4
Joined: Sat Jul 09, 2022 6:31 am

How to detect an animation has completed? Also is there a more complete scripting documentation anywhere?

Post by GenzDev » Sun Jul 17, 2022 7:07 am

Hi, hoping someone can help explain how to go about detecting that a non-looping animation has completed? eg to make the game wait for completion before moving a character etc.

I've found some comments around a CreatureAgent.AnimationReachedEnd. Not sure if this is what i'm looking for? I tried attaching it to the renderer along with CreatureGameController and having AnimationReachedEnd print a message but couldn't get it to work.
I couldn't find any documentation/resource or forum post that explains how to do this or set it up. The existing documentation is great for 'how to do certain things' but is there a more basic but comprehensive scripting guide anywhere?

Many thanks!

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: How to detect an animation has completed? Also is there a more complete scripting documentation anywhere?

Post by chong » Sun Jul 17, 2022 12:13 pm

Hello,

You can take a look here as a referenced:
https://github.com/kestrelm/Creature_Un ... le.cs#L419

You can put some printouts there and trace through the code to see if it hits the end call.

Thanks

GenzDev
Posts: 4
Joined: Sat Jul 09, 2022 6:31 am

Re: How to detect an animation has completed? Also is there a more complete scripting documentation anywhere?

Post by GenzDev » Tue Jul 19, 2022 1:44 pm

Thanks will try that out! I'm also seeing if an event trigger will suit my situation.
I've got the event in the creature meta which is added to the object as json. Trying to understand how to use the gamecontroller eventtrigger though. Is there anywhere that gives a really basic example? Everything seems to say go and read the unity docs on events/delegates, but i'm just hoping to see a super basic example of what this might look like using the creature game controller to recognise an event and print text or something..

Post Reply