- Home /
Design/discussion question
Making a spawn point
I'm making a level where I have 2 gorge that I have to cross across in order to proceed further on in to the level. The first gorge has a series of rocks to jump across to reach the other side, and the second gorge has a tree in which I use a rope to pull down to use as a bridge to cross.
But my question is thus: I want to make it so that there are 2 spawn points, 1 before the first gorge, and another before the second, so that should the player fail to make it across either gorges, and fall to their deaths they respawn at which ever spawn point is set before whichever gorge they happen to fall in to, but here's the problem; I'm really not all that great at coding, so I don't really know what I would need to do.
I have a script set up to destroy the fpc (first person controller) object, but I need help with the respawn script. I'm not asking for a full blown script (because that isn't going to help me learn) but maybe just a list of things that I need to do, and what variables and what not to declare and so on.
Unity Forums is the place for design questions. Consider not destroying your NPC, but simply moving him...perhaps hiding him for a short period of time if needed. You may have to save and restore some state.
It's not an NPC I'm destroying, it's the actual game controller itself (if using the character controllers). I'm trying to kill the player, and then have them spawn to a set destination, but I suck at coding, so I'm having a rather difficult time with it.
Answer by robertbu · Nov 04, 2014 at 12:02 AM
My advice still holds. Rather than Instantiate() a new player, just reset his position to your spawn point on death. If you need a pause, hide your player and turn off the CC and use Invoke() or a coroutine to delay the move.