Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: gordonramp on October 26, 2013, 12:14:18 AM

Title: Click multiple gameobjects to create an event?[SOLVED]
Post by: gordonramp on October 26, 2013, 12:14:18 AM
Hi There,
Just starting to get into Playmaker and what I am trying to achieve is this..
I have three spheres and I want to click on each one before a fourth gameobject becomes visible. So.. if this is clicked and this is clicked and this is clicked then this becomes visible.
Is there facility already built in the Playmaker to achieve such a process or will I need to create a special variable and if so, how would it look? I have managed to get it working on one sphere using 'Mouse Up' and 'Activate Game Object' but how to on three? Thanks.

Title: Re: Click multiple gameobjects to create an event?
Post by: uberwolfe on October 26, 2013, 01:41:44 AM
Hi. The following is one way you could do this:

Make sure the 4th sphere has its mesh renderer disabled in the inspector so it is invisible when the scene is played.

Create a global integer.

Create an FSM with a Mouse Pick Event on each sphere that fires off an event to add 1 to this global integer when it is clicked.

Have an FSM on the 4th sphere that watches the global integer (use Int Compare action) and enables the mesh renderer on itself when the global integer reaches 3.

You can access the mesh renderer settings on the 4th sphere by using the Set Property action, or by dragging the object onto the action window.

Hope that makes sense, happy to clarify anything if needed :)

Something like this on three spheres:
(http://i.imgur.com/EJlqMNj.jpg)

And this on the fourth sphere:
(http://i.imgur.com/AGZemJL.jpg)
Title: Re: Click multiple gameobjects to create an event?
Post by: gordonramp on October 26, 2013, 02:05:09 AM
Ok, I'll play around with this idea.. :)
Title: Re: Click multiple gameobjects to create an event?
Post by: Yanifska on October 27, 2013, 10:12:43 AM
If you havent already watched it you should check this tutorial :
Title: Re: Click multiple gameobjects to create an event?
Post by: gordonramp on October 27, 2013, 04:43:44 PM
Thanks Yanifska, that is most helpful.