Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: markfrancombe on May 04, 2012, 08:44:20 AM

Title: [SOLVED] Recieving and Sending Animation events
Post by: markfrancombe on May 04, 2012, 08:44:20 AM
Ive just started on PlayMaker so excuse the newb-ness.

Im trying trigger a bunch of different animations in a scene from one MAIN animation. This is for a kind of "fly-Thru" cut scene/intro movie to my game.

I made an animation on the camera as it flys thru a city, at certain points I want to trigger other, seperate animations that should happen at exact moments in the main fly thru.
At these moments I add an Event to the Main animation, and using this page...

https://hutonggames.fogbugz.com/default.asp?W181

...I learned to thus send an event to PlayMaker....

But what now??

I set all the animations that are applied to objects in the scene to NOT play automatically, so that they dont play from start of scene.

I add a FSM to the camera object (that contains the Main Animation) and now what..?
The event on the timeline is SendEvent("BlockFall")
What do I add to the FSM to listen for this event and then run a state with the "Play Animation" State.

I have figured out that I can add a Play Animation State and set the game object to a different object, and found the BlockFall animation.
Its the interim state I need, the one thats waiting for the animation event.

I think this is theoretically a very good way to put together an animation, because I can put all the main timing of animations into one clip hat just trigger lots of additional animations. I can even add an event at the end of the cut scene/intro that loads the next Unity scene, which is the scene with the main gameplay.

I hope this made sense, Im not sure Im getting all the correct terminology.

Regards

Mark


Title: Re: Recieving and Sending Animation events
Post by: markfrancombe on May 04, 2012, 09:49:31 AM
Ill answer my own post.

After creating an event withe same name as the one on the Animation Event, I needed to actually add it to.. err... the first box. I rt clicked the bottom half of the box (the bit that had ... on it)  and in transition Events found my Event listed.. et Voilá as they say in France!

I hope this helps someone else, Im sure I cant be the only dolt on the net...

Mark
Title: Re: [SOLVED] Recieving and Sending Animation events
Post by: Alex Chouls on May 04, 2012, 08:41:32 PM
Quote
I think this is theoretically a very good way to put together an animation, because I can put all the main timing of animations into one clip hat just trigger lots of additional animations. I can even add an event at the end of the cut scene/intro that loads the next Unity scene, which is the scene with the main gameplay.

Yes, this is a very powerful technique!

Glad you got it working...
Title: Re: [SOLVED] Recieving and Sending Animation events
Post by: markfrancombe on October 25, 2012, 07:29:11 PM
WHAT THE HELL!!

I figured this out once, now I came back to this same technique after half a year and I cant figure it out!!

How do I get a function to appear in the Event thing in the Anim Timeline...

Here...(https://www.evernote.com/shard/s73/sh/b5f32d1c-631e-4c2b-8ded-2ce07de00595/06960e0ad8a58fe8b9ad32b305368c4e/res/17d213ae-b28c-4e35-9c1c-5d570b8fc075/skitch.png)

I think I understand my own instructions later, but when I said...

https://hutonggames.fogbugz.com/default.asp?W181

...I learned to thus send an event to PlayMaker....

... I was cleverer of less sleepy then... cos NOW I cant figure that out!!!

HJELP!

Mark
Title: Re: [SOLVED] Recieving and Sending Animation events
Post by: jeanfabre on October 26, 2012, 01:59:26 AM
Hi,

 Your image link is broken, can you update this?

bye,

 Jean
Title: Re: [SOLVED] Recieving and Sending Animation events
Post by: markfrancombe on October 27, 2012, 03:00:34 PM
Hows this?

http://tinyurl.com/93lvryh

So to be clear on my question: The pic shows a big pink arrow pointing to an animation event in the Unity Anumation Timeline.

I wanna know.. how does THAT get there, I try and select something and i just get a drop down with NO functions in...

Weirdly I knew how to do this once, but cannot get my head round it now!
Title: Re: [SOLVED] Recieving and Sending Animation events
Post by: markfrancombe on October 27, 2012, 03:18:53 PM
OK figured it out now... !!

Again...

Just to post the solution, incase I forget it again! ha ha...

I was trying to send an animation event to a DIFFERENT game object than the one with the animation on.
WRONG...

Correct is to add an animation AND a FSM to the same object, and THEN the function will show up in the Anim event drop-down...

Thanks you Mark for you help

You are welcome Mark, no problem!

Regards

MArk