playMaker

Author Topic: Send Message with current object  (Read 3084 times)

tjgillis

  • Playmaker Newbie
  • *
  • Posts: 3
Send Message with current object
« on: October 04, 2012, 11:14:06 PM »
Hi all,
I would like to use a send message action to send the current object as the parameter without having to explicitly set it. I would ideally like to make the FSM a template and not have to set each time the variable I'm sending.

Thanks

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: Send Message with current object
« Reply #1 on: October 05, 2012, 04:53:49 AM »
do you mean the "get component" action? It returns the object of a gameObject.
Best,
Sven

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Send Message with current object
« Reply #2 on: October 05, 2012, 06:17:02 AM »
Hi,

 Simply leave the field to "use owner", this is your gameObject the fsm is attached too.

bye,

 Jean

tjgillis

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Send Message with current object
« Reply #3 on: October 05, 2012, 09:00:13 AM »
Thanks for the replies, but I think I'm missing something lol. So I took a screenshot:



I have an item with the FSM on it. I want to get that item and pass it as the param in the message message.  Currently I have the get parent disabled as it's not working properly for me. So instead of plate1 as the param I would ideally like object that the FSM is currently attached to.

I didn't see a use owner for the param :S

I tried the get component as well but I'm not sure how to get a gameobject from that.

Thanks,
TJ

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: Send Message with current object
« Reply #4 on: October 05, 2012, 09:22:59 AM »
"get owner"?! You want the gameObject the FSM belongs to? That's the owner.For the record, gameObject and object are something entirely different ;)
So use "get owner" first, then click the icon right of the input field of the send message to make it so you can plug in the variable instead of the typed in string.
« Last Edit: October 05, 2012, 09:24:36 AM by kiriri »
Best,
Sven

tjgillis

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Send Message with current object
« Reply #5 on: October 05, 2012, 09:25:04 AM »
how the heck did I miss get owner ? *facepalm*
Thanks! thats exactly what I was looking for!