playMaker

Author Topic: Click Blocking  (Read 2415 times)

JennaReanne

  • Junior Playmaker
  • **
  • Posts: 57
    • Little Worlds Interactive
Click Blocking
« on: July 02, 2013, 11:09:17 AM »
Hi all - I'm working on the tutorial for my game and wanted to check in to see how other people have solved the click blocking problem.  Basically I would like to prevent the player from clicking on anything other than the focus of the tutorial at that moment.  For example, first they can only click on the green monster, then they can only click on the 3rd spell, etc.  Clicking on anything else would bring up some sort of "Please follow the tutorial" message.

How have other people implemented this type of tutorial feature?  My thought was to create a global variable gameobject "Focus".  When an object is clicked it checks this variable - if it is null or itself then it continues.  If not, it pops up the error message.  Then I would just need a manager to handle the Focus variable.  Does this make sense?  Is there a better way to do it?

Thanks!
-Jenna

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • Blog
Re: Click Blocking
« Reply #1 on: July 02, 2013, 01:00:41 PM »
You just need to add 1 layer and work with some actions (please see the pick action example in samples).

Your layer is for tutorial objects. You need to know is number.

Set your tut objects to that layer and another objects to default layer.The you will pick the picked object and get is layer number, and then compare if your object is tut object or not.
There is just a simple scene that shows that. Set my tut objects to a layer in User Layer 8.




JennaReanne

  • Junior Playmaker
  • **
  • Posts: 57
    • Little Worlds Interactive
Re: Click Blocking
« Reply #2 on: July 02, 2013, 03:29:00 PM »
Hi Sebastiao - thanks for putting together the example scene!  The desired gameplay would be that I have a tutorial with 10 different steps, and on each step the clickable object is different (with everything else unclickable).  Would you recommend that I just change each objects layer to and from "Tutorial" to accomplish this?

Thanks!

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • Blog
Re: Click Blocking
« Reply #3 on: July 02, 2013, 05:46:41 PM »
I would recommend you after you pass the first step set the old task object as default layer.And then in the next task object set is layer as tut object.
I´m sorry but if in your game you have much tip of objects I recommend you begin working with tags and not layers. Because you can only have 20-30 layers and with tags you can have infinite tags. So if you want to change just work with "Game Object Compare Tag" action. I recommend you change to tags.
Cheers
Seb