Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: tjgillis on October 04, 2012, 11:14:06 PM

Title: Send Message with current object
Post by: tjgillis 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
Title: Re: Send Message with current object
Post by: kiriri on October 05, 2012, 04:53:49 AM
do you mean the "get component" action? It returns the object of a gameObject.
Title: Re: Send Message with current object
Post by: jeanfabre 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
Title: Re: Send Message with current object
Post by: tjgillis 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:

(http://i.imgur.com/f22xV.png)

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
Title: Re: Send Message with current object
Post by: kiriri 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.
Title: Re: Send Message with current object
Post by: tjgillis 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!