• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED Respawning Layers.

bodilliam

Member
I have falling spikes in my platformer, and when the player dies I want the spikes to respawn but not the whole room. the spikes are placed in the Room editor not in code. Thanks!
 
D

Deleted member 13992

Guest
Save their starting y position in a variable in their create event. Then somewhere in your player respawn control object or script, add something like this:

GML:
with (obj_spike) {
    y = y_start;
    state = hanging;
    etc
}
 

bodilliam

Member
Save their starting y position in a variable in their create event. Then somewhere in your player respawn control object or script, add something like this:

GML:
with (obj_spike) {
    y = y_start;
    state = hanging;
    etc
}
Sorry, can you elaborate? when the spikes fall the instance gets destroyed.
 

bodilliam

Member
Save their starting y position in a variable in their create event. Then somewhere in your player respawn control object or script, add something like this:

GML:
with (obj_spike) {
    y = y_start;
    state = hanging;
    etc
}
Thanks! this solved it!
 
Top