Stacking beams gdevelop

Hello there !

I’m currently making a remake of a metroid game, so i’m trying to stack my beams
for exemple:
You start with the power beam (refered as “pw_beam”)
I want that when u take the power up (refered as i_beam_obj) for getting ice beam (refered as i_beam),
it replace the standard “pw_beam” with "i_beam"

I tried many way to do that like : adding a new object, or replacing the first animation with the second one (all beams stacked in one entity) etc…
But my second question is: if I have no choice to stack’em all in the same place, could I change their value ? (damages, go thru walls etc… ?)

If someone could help me, it would be great !

what did you mean by that? Did you mean upgrading? If yes then you can make a variable, maybe an object variable. At the beginning of the game(not scene), change the variable to 0. When the variable is 0, give Player a pw_beam, and if 1 then give Player an i_beam.

I tried to give’em a name variable but it doesnt work, what have I done wrong ?

Add an action here:

Only then this will work

Work well, but i used a scene var instead, is it ok ?

No problem. But if you want the upgrade to work in all scenes, use the global variable.

I changed it by “Global Variable”
But when i transite to the next scene, when i take the upgrade, i lost it when the scene change…
How can i fix this ?
I know it’s not “At the begenning of the scene” to be there but something like “At the start of the game” but i dont find it…

Nevermind, i found a way, i just change the “At the begenning” by :
The boolean value of Beam is False - Change the Global Variable of Beam = 0
Thx for the help !! :slight_smile: