Creature Unity Events

Discuss issues pertaining to the various game/web runtimes of Creature here.
Post Reply
PeteA
Posts: 5
Joined: Sat Feb 02, 2019 5:15 pm

Creature Unity Events

Post by PeteA » Wed Mar 13, 2019 10:08 pm

Dear Chong,

I am currently adding some events to trigger colliders and sounds in my animations. My exported creature project holds 8 animations, two of which have events attached to them. In unity I have inherited my character class from CreatureGameAgent. Here I subscribe my function to the event system setup in CreatureGameController. My function triggers a box collider, which is a damage trigger. However, my function is called during every event trigger. Can I select which event trigger, triggers my function. For example 'event0' triggers the event and 'event1' does not. Hope that makes sense, and i'm probably just missing something simple.

Thanks for your help,

Pete

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

Re: Creature Unity Events

Post by chong » Wed Mar 13, 2019 11:51 pm

Hello,

Here is how the events are currently processed:
https://github.com/kestrelm/Creature_Un ... er.cs#L466

It will go through each event and then trigger the event if there is one at the current frame. It will pass in the name of the event so you are expected to parse that name and based on it decide what to do with that event (or ignore it ). Feel free to modify those lines to fit your own event model if you want to.

Cheers

PeteA
Posts: 5
Joined: Sat Feb 02, 2019 5:15 pm

Re: Creature Unity Events

Post by PeteA » Thu Mar 14, 2019 8:23 pm

Hi Chong,

Great thanks! Modified and added several events conditioned to the event names. Couldn't see this last night, must have been tired. This functionality is really a great benefit of the creature software and very easy to implement/customise. :lol:

Cheers,

Pete

Post Reply