playMaker

Author Topic: Get component from global variable returns "none"[SOLVED]  (Read 2058 times)

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Get component from global variable returns "none"[SOLVED]
« on: February 16, 2017, 04:35:08 AM »
Hi,

I had the same problem as this tread - (http://hutonggames.com/playmakerforum/index.php?topic=6821.msg33537#msg33537)

I used his solution that you can find at the bottom of the thread, and it works perfectly!

The thing is I do not need to use "Find game object" because my game object is already stored in a global variable. So when I remove the "Find game object"-action and just put the global variable as reference in the "Get component"-action. The "get component" returns "none".

So it seems that I need to use "Find game object" anyway, even if the game object  already is stored in a global variable.

Is there a way to use the global variable instead? (I do not want to use the Find object action due to performance)
« Last Edit: February 21, 2017, 03:16:58 AM by jeanfabre »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Get component from global variable returns "none"
« Reply #1 on: February 19, 2017, 07:06:15 PM »
Had a similar problem, put an fsm on the object in question with get owner so it will store it every time when you hit play.
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get component from global variable returns "none"
« Reply #2 on: February 20, 2017, 01:21:12 AM »
Hi,

 If the global variable has a gameobject that is not anymore in the scene that would happen.

Bye,

 Jean

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Re: Get component from global variable returns "none"
« Reply #3 on: February 20, 2017, 05:08:33 AM »
Hi,

 If the global variable has a gameobject that is not anymore in the scene that would happen.

Bye,

 Jean

aha, that makes sens. thanks