Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Seiryu33 on May 20, 2015, 09:46:31 PM

Title: Global Prefabs
Post by: Seiryu33 on May 20, 2015, 09:46:31 PM
I have an on-going issue with Prefabs.  More specifically the Character's Health gauge, etc. I tried to set it so that the current status remains constant (like Health damage carrying over until the player is cured.) 

It works in the scene, but then stops working when I make it a prefab. The Screenshot is basically how I have the Health Gauge set-up. I animated it by hand and then linked up so that the Health Gauge takes a specific amount of damage from enemies. As stated before it works until I make it a prefab. How do I make the damage concurrent throughout the game?  I tried to follow tutorials about Global events but felt my head about the split. Any advice?
Title: Re: Global Prefabs
Post by: jeanfabre on May 21, 2015, 06:35:12 AM
Hi,

-- are you using global variables?
-- Are you using references in the hierarchy? you can't do that in a prefab because it looses references to other GO outside of itself( you can reference go inside the prefab, likt childs or parents, but not outside).

 Bye,

 Jean
Title: Re: Global Prefabs
Post by: Seiryu33 on May 22, 2015, 03:29:02 AM
What about power-ups and things like that?  That kind of ties nto the same problem I'm having with the Health Gauge. My game uses an inventory system similar to Zelda's but I'm not sure how to send power-ups and player items to the inventory screen and still effect the Player character.

 I set the Player character as a Global GameObject using the Set GameObject action. Was I on the right track? Would I have to do that for every object in the Inventory? I thought of using the Load Level action but that won't work I don't think. Is there a better way to achieve this?
Title: Re: Global Prefabs
Post by: Seiryu33 on May 31, 2015, 07:10:15 PM
Bumping this since my issue relates to the same problem. I guess my main issue, is how do I go about accessing gameobjects in different scenes or the same GameObject in different scene? I watched the Tutorial on doing Send Event actions but I think that method on works in the current Scene. Like in my situation, new stages and  areas become available only after you've beaten a stage. Its basic approach is similar to the one used in Super Mario World. I'm stuck on how to proceed since it's already been established that you can't directly interact with Prefabs in a scene and setting them as Global GameObjects doesn't work either. Would making the Prefab and then using the Create GameObject during scene transition work? That's the only way I know how to use Prefabs so far.