Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Mupp on July 19, 2018, 09:23:28 AM

Title: How to get a component variable from a GameObject variable?[SOLVED]
Post by: Mupp on July 19, 2018, 09:23:28 AM
I want to get the X size of a box collider on the object that is currently stored in a GameObject variable. How do I do that?
Title: Re: How to get a component variable from a GameObject variable?
Post by: jeanfabre on July 19, 2018, 09:57:51 AM
Hi,

 you either do this using GetProperty action, or you get the dedicated custom action GetBoxColliderSize from the Ecosystem.

 Bye,

 Jean
Title: Re: How to get a component variable from a GameObject variable?
Post by: Mupp on July 19, 2018, 10:54:29 AM
Thanks, the GetBoxColliderSize should work, but for future reference, how do you use GetProperty with a GameObject variable? Can you give me an example how to store a variable from a component on an unknown object?
Title: Re: How to get a component variable from a GameObject variable?
Post by: jeanfabre on July 19, 2018, 02:25:37 PM
Hi,

simply drop the Component onto the Action stack.

 
 Bye,

 Jean
Title: Re: How to get a component variable from a GameObject variable?
Post by: Mupp on July 19, 2018, 03:27:02 PM
Um, I don't think you understand. I can't drag the object because it is stored in a variable. It's unknown, otherwise it would been really easy.
Title: Re: How to get a component variable from a GameObject variable?
Post by: Mupp on July 21, 2018, 09:04:23 PM
Bump.
Title: Re: How to get a component variable from a GameObject variable?
Post by: Fat Pug Studio on July 22, 2018, 04:15:03 AM
Did you save the component as object variable? I'll make a small gif later.
Title: Re: How to get a component variable from a GameObject variable?
Post by: Mupp on July 22, 2018, 08:06:27 AM
Yeah, that's what I tried to do, but it's at that point it gets tricky for me.  :-\
Title: Re: How to get a component variable from a GameObject variable?
Post by: Fat Pug Studio on July 22, 2018, 10:00:12 AM
There you go

Title: Re: How to get a component variable from a GameObject variable?
Post by: Mupp on July 22, 2018, 11:42:18 AM
That's excellent. That's what I was looking for. Thanks a lot man.  ;D
Title: Re: How to get a component variable from a GameObject variable?
Post by: Fat Pug Studio on July 22, 2018, 12:26:11 PM
Great :)