playMaker

Author Topic: Selecting individual objects around a scene with left click [SOLVED]  (Read 2683 times)

Drunkenoodle

  • Playmaker Newbie
  • *
  • Posts: 25
Hello everyone,
I'm fairly new to Playmaker (as in the weekend just gone), and I absolutely love it. Currently I'm just having a bit of a play around but I've become a little stumped on trying to make an FSM perform a certain process.

My plan is to enable some kind of mouse pick event that will select different objects around the scene. That much is no problem, as the debug log updates according to whatever I click (at the store object parameter). But after that I'm not sure how to set say a Bool that continues the process if a specific type of object is selected.

Basically in an RTS fashion, the idea was that once the player object has been selected, you can move it on to the next part of the process such as setting it a target to move to.

Hopefully that wasn't too wordy and made sense!
Many thanks.
« Last Edit: June 28, 2012, 04:23:02 AM by Drunkenoodle »

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Selecting individual objects around a scene with left click
« Reply #1 on: June 26, 2012, 09:10:01 PM »
I think i understand what you're trying to do...

how i would approach it woudl be to first store the gameobject clicked on (with the mouse-pick there is an option where you can store what you clicked in a gameobject variable) and in another state, tell it to compare it by it's tag (assuming it's tagged in the inspector) and if it is met, continue to the next state and if not, go back to the state where it's waiting for input from the mouse-click.

let me know if this is what you're looking for and how that works for you.

Drunkenoodle

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Selecting individual objects around a scene with left click
« Reply #2 on: June 27, 2012, 03:55:07 AM »
Hi Red,
That's exactly what I'm after. I'll give that a try and be sure to pop the results back on here.

Thank you very much!

Drunkenoodle

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Selecting individual objects around a scene with left click
« Reply #3 on: June 28, 2012, 04:21:33 AM »
Hello!
Just to confirm that your theory worked wonders Red. I managed to create quite a few processes, from moving to a position set by the mouse, to attacking a target, etc.

Ended up using the Comparetag method, along with Mousepick and finally boolean events to set whether said tag was active or otherwise.

Thanks again for all your help!

(I attached a screenshot in case anyone can make use of it).