Before updating to Windows 10 you may need to return your Pro license. More information here

Character Respawn


Currently in my game, I have the character respawning back to life in the exact same spot at the start of the game. But lets say the character makes it midway of the game and dies. How do I get the character to respawn midway of the game?

Here is the script Im currently using for character respawn.

private var StartPos : Vector3; function Awake() { StartPos = transform.position; } function OnTriggerEnter(other : Collider) { if(other.gameObject.name == "fallout") { //RESPAWN! HealthGui.LIVES -= 1; StartPos.y += 4;

           transform.position = StartPos;


more ▼

asked Jan 20, 2011 at 09:04 PM

avatar image

41 89 61 65

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Why don't you setup a midway trigger object, and when the character hits the trigger you can change the value of your Vector3 that is the start position to the position of the trigger object. This way you are effectively just moving the spawn point to the middle of the level instead of the beginning.

more ▼

answered Jan 20, 2011 at 09:11 PM

avatar image

96 4 3 11

agree with this one. Just make a checkpoint, with a script inside it that removes the activePt from the startingPoint.

May 12, 2011 at 03:18 AM AnotherChris
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Jan 20, 2011 at 09:04 PM

Seen: 2377 times

Last Updated: Jan 20, 2011 at 09:04 PM