playMaker

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

Mupp

  • Junior Playmaker
  • **
  • Posts: 69
    • View Profile
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, 11:51:28 AM by djaydino »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15403
  • Official Playmaker Support
    • View Profile
Re: How to get a component variable from a GameObject variable?
« Reply #1 on: July 19, 2018, 06: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

  • Junior Playmaker
  • **
  • Posts: 69
    • View Profile
Re: How to get a component variable from a GameObject variable?
« Reply #2 on: July 19, 2018, 07: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: 15403
  • Official Playmaker Support
    • View Profile
Re: How to get a component variable from a GameObject variable?
« Reply #3 on: July 19, 2018, 11:25:37 AM »
Hi,

simply drop the Component onto the Action stack.

 
 Bye,

 Jean

Mupp

  • Junior Playmaker
  • **
  • Posts: 69
    • View Profile
Re: How to get a component variable from a GameObject variable?
« Reply #4 on: July 19, 2018, 12: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

  • Junior Playmaker
  • **
  • Posts: 69
    • View Profile
Re: How to get a component variable from a GameObject variable?
« Reply #5 on: July 21, 2018, 06:04:23 PM »
Bump.

krmko

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

Mupp

  • Junior Playmaker
  • **
  • Posts: 69
    • View Profile
Re: How to get a component variable from a GameObject variable?
« Reply #7 on: July 22, 2018, 05:06:27 AM »
Yeah, that's what I tried to do, but it's at that point it gets tricky for me.  :-\

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 1087
    • View Profile
    • Fat Pug Studio

Mupp

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

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 1087
    • View Profile
    • Fat Pug Studio
Re: How to get a component variable from a GameObject variable?
« Reply #10 on: July 22, 2018, 09:26:11 AM »
Great :)