playMaker

Author Topic: Help for a Noobie please! :-) [SOLVED]  (Read 2132 times)

c68

  • Playmaker Newbie
  • *
  • Posts: 3
Help for a Noobie please! :-) [SOLVED]
« on: June 10, 2016, 11:18:44 AM »
Hello everyone,

I'm currently trying to click together my first FSMs in Unity... Everything is very smooth and nice so far... buuuut ...

Im trying to make an FSM for a "MapNode Prefab" that I would like to put on important points on my 2D-map. When the player moves the mouse over a point on the map, a "green dot" should appear on screen to indicate that its possible to move to this point on the map in the game. On a click a new Unity scene will be loaded.

So far so good... I managed it have an FSM like in the attached image.

The problem is... the "Activate MapNode Ava" state is the state the FSM stops when I hit play in Unity... It should go back to the "Wait for Mouse Input" state and wait for the next mouse event to occur...

This might be a noobish question... I know...  :D
But how do I manage it to have the "Acitvate MapNode Ava" go back to wait...  :o

I sent it back on "FINISHED" ... but that seems not to work like I expect :D

Thanks for any suggestions!
c68
« Last Edit: June 10, 2016, 05:12:08 PM by c68 »

ergin

  • Junior Playmaker
  • **
  • Posts: 86
Re: Help for a Noobie please! :-)
« Reply #1 on: June 10, 2016, 12:10:34 PM »
Actually it should continue to Finished(Find Child has finish() in its OnEnter). You can try deleting and re-adding "finished" transition. You can always force any event by using Send Event (Self as event target and place it at the very bottom of State)

c68

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Help for a Noobie please! :-)
« Reply #2 on: June 10, 2016, 12:51:39 PM »
Wohoooooo! It works now!

Thanks ergin for the quick tip! :-)

I added a "Send Event" Action at the bottom of the state, as you sugested - that did the trick!

One very important thing is to set the Box Collider of the MapNode to "is trigger"!!!
Otherwise it won't work properly!

This is the final layout of the FSM (I managed it to include the "Activate MapNode Ava" into the start state so its "cleaner"):

ergin

  • Junior Playmaker
  • **
  • Posts: 86
Re: Help for a Noobie please! :-)
« Reply #3 on: June 10, 2016, 02:37:51 PM »
Thanks. If you select "every frame" for any action it will keep repeating every frame. Usually setting a bool only once is enough so turning off every frame may be a better solution.

c68

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Help for a Noobie please! :-) [SOLVED]
« Reply #4 on: June 10, 2016, 05:13:22 PM »
Yes, I turned "every frame" off... Still works perfect. Thanks for the hint! :-)

ergin

  • Junior Playmaker
  • **
  • Posts: 86
Re: Help for a Noobie please! :-) [SOLVED]
« Reply #5 on: June 10, 2016, 06:39:09 PM »
No problem...  ;D