Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: m1 on April 26, 2012, 01:39:07 PM

Title: [SOLVED] Action on a Prefab not working as expected
Post by: m1 on April 26, 2012, 01:39:07 PM
I have looked through many of the discussion threads about prefab issues, but I'm not sure that my issue has been addressed.  Perhaps I just missed a something in the instructions.

My issue is that when I am applying an action to a prefab, such as 'Get Distance', I can not select a target object from my hierarchy to be applied.  The action won't let me.  When I apply 'Get Distance' to an object in the hierarchy directly, then select another object to use as the target it works just fine.  

Is this a bug, or something that is just not capable of happening?

Thanks!
Brian
Title: Re: Action on a Prefab not working as expected
Post by: Alex Chouls on April 26, 2012, 07:40:44 PM
In Unity, prefabs cannot reference scene objects, only other prefabs/assets.

So you need to find the target object at runtime and store it in a variable.

Does that make sense? This is a common confusion with prefabs...
Title: Re: Action on a Prefab not working as expected
Post by: m1 on April 29, 2012, 05:11:51 PM
OK thanks for the info Alex.  I guess I misunderstood how to use Prefabs properly.