How do I…
I want to make the camera center on the last position before the player was killed in the platformer game before respawning.
What is the expected result
Camera is centered on the last position where player was killed, death particles played, then player respawns 1.5 seconds later and the camera lerps to the player.
What is the actual result
When the player dies the camera just went somewhere else
Hi, in Gdevelop your events in a block are triggered from above to below. Thus the order of events is important. In your last block you delete Stickman_player1 before you center the camera on this object. Since the object does not exist anymore, the camera action cannot be triggered properly.
I can think of two solutions:
- You don’t delete the stickman-object until you change the scene
- You store the x- and y-position of the stickman-object in variables and use them as references for the camera-action.
Oh I see, I’ll try that later.
Alright i used the first method, did not delete the stickman_player, i made the stickman unable to move when it’s “alive” variable is false, and center camera on it and play the death particles. And It works! Thank You!