- Home /
Can you guys Help me create a spawn mechanism where the player actually respawns in a platform(check for more details)
Hello, I have this 2d infinite runner game that I actually have created a respawn mechanism, the problem is my respawn mechanism is very wrong. I use this codes to transform the players position
PlayerPrefs.SetFloat("XCheckPoint",(Player.position.x+10));
PlayerPrefs.SetFloat("YCheckPoint",(Player.position.y+10));
what this does is actually just add 10 to the x and y position so I could achieve this.
//when the player dies
//when the player respawns
so again what I want is to make the player respawn directly in the platform. I actually have no problem with the x position + 10, I think its an Ok distance what I want is the Y to be directly correspond with the platform. P.S. the Platform's Y position aren't the same meaning a Platform is high, a Platform is low a Platform is medium. I think we need the Platforms position right? the problem is its not actually Randomly respawned. It is actually Manually put into. Please ask more question if need be. I know this asking much. But please bare with me.
Your answer
Follow this Question
Related Questions
How do I get my 2D game camera to view the respawned sprite? 1 Answer
Type"PathDefinition" does not contain a definition for "GetPathEnumerator" 0 Answers
How can i create a 2D polygon map for my infinte runner game 0 Answers
Platforms are been generated more and more to the left or right 0 Answers
I'm trying to make platforms generate between two platforms which are already generated. 0 Answers