PlayMaker News > General Discussion
Activating objects between scenes
reveille:
Hope someone can help.
How do you activate an object say a weapon on a character when it is brought or unlocked in the shop scene-in another scene.
GonerGames:
Use a global variable in Playmaker.
eg. Weapon 1 - Bool - True or false. (true unlocked)
You can reference global variables from any scene.
djaydino:
Hi,
Be careful with using globals.
Always try to minimize using globals.
Another way is to get into scene managing.
And keep your player as a scene with all its data, and load different scenes/levels.
Check out this unity video it will explain more how it works :
//www.youtube.com/watch?v=dA4oOm3wCIc
search for 'scene' in your action window to see the available actions for this.
verybinary:
I like Dino's answer, and I'm not sure if the management technique that I started planning logistically was what he was actually talking about, but either way, he got the ball rolling. Ill check it out when I'm not at work. Can't youtube here.
But my original help would be to put your hasweapons variables/array on the player itself. Then your player could keep up with it, and your menu system and player can chat over a coffee when the menu loads.
I also don't think a global array would cause a major cleanup issue, especially compared to individual weapons, but it wouldn't seem "right" to use that as a global anyways.
djaydino:
Hi.
One of the reasons i prevent using globals is that they are a lot easier to be hacked.
i only use them sometimes to connect to my game manger fsm or some other managers (controller / audio / ai / etc..)
Navigation
[0] Message Index
[#] Next page
Go to full version