playMaker

Author Topic: How to get a component variable from a GameObject variable?[SOLVED]  (Read 1964 times)

Mupp

  • Full Member
  • ***
  • Posts: 167
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?
« Last Edit: July 22, 2018, 02:51:28 PM by djaydino »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to get a component variable from a GameObject variable?
« Reply #1 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

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: How to get a component variable from a GameObject variable?
« Reply #2 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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to get a component variable from a GameObject variable?
« Reply #3 on: July 19, 2018, 02:25:37 PM »
Hi,

simply drop the Component onto the Action stack.

 
 Bye,

 Jean

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: How to get a component variable from a GameObject variable?
« Reply #4 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.

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: How to get a component variable from a GameObject variable?
« Reply #5 on: July 21, 2018, 09:04:23 PM »
Bump.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: How to get a component variable from a GameObject variable?
« Reply #6 on: July 22, 2018, 04:15:03 AM »
Did you save the component as object variable? I'll make a small gif later.
Available for Playmaker work

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: How to get a component variable from a GameObject variable?
« Reply #7 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.  :-\

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Available for Playmaker work

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: How to get a component variable from a GameObject variable?
« Reply #9 on: July 22, 2018, 11:42:18 AM »
That's excellent. That's what I was looking for. Thanks a lot man.  ;D

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: How to get a component variable from a GameObject variable?
« Reply #10 on: July 22, 2018, 12:26:11 PM »
Great :)
Available for Playmaker work