Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Krillan87 on February 16, 2017, 04:35:08 AM

Title: Get component from global variable returns "none"[SOLVED]
Post by: Krillan87 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)
Title: Re: Get component from global variable returns "none"
Post by: Fat Pug Studio 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.
Title: Re: Get component from global variable returns "none"
Post by: jeanfabre 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
Title: Re: Get component from global variable returns "none"
Post by: Krillan87 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