Hi, guys.
I have a problem with my checkpoints. So far I have created 4 checkpoints. But if the player has already died 2 times every next time he dies he is respawned on the position of the 2nd checkpoint that he was respawned to.
For example: let's say there are 4 rooms. When the player enters each room he gets a checkpoint outside THAT ROOM and then dies(under mysterious circumstances
). So the player enters the FIRST ROOM-dies and is respawned outside the FIRST ROOM. Then he enters the SECOND ROOM- dies and is respawned outside the SECOND ROOM. And then he enters the THIRD ROOM- dies and is respawned outside the SECOND ROOM. Same for the fourth.
If you understood anything from my petty attempt to explain my problem, here is the script for the 4 Checkpoints. I don't know if the problem is in the script, though.
void OnStart()
{
AddEntityCollideCallback("Player", "CheckpointArea1", "CreateCheckpoint1", true, 1);
AddEntityCollideCallback("Player", "CheckpointArea2", "CreateCheckpoint2", true, 1);
AddEntityCollideCallback("Player", "CheckpointArea3", "CreateCheckpoint3", true, 1);
AddEntityCollideCallback("Player", "CheckpointArea4", "CreateCheckpoint4", true, 1);
}
void CreateCheckpoint1(string &in asParent, string &in asChild, int alState)
{
CheckPoint("", "CheckPoint1", "", "DeathHints", "DeathHint1");
}
void CreateCheckpoint2(string &in asParent, string &in asChild, int alState)
{
CheckPoint("", "CheckPoint2", "", "DeathHints", "DeathHint2");
}
void CreateCheckpoint3(string &in asParent, string &in asChild, int alState)
{
CheckPoint("", "CheckPoint3", "", "DeathHints", "DeathHint3");
}
void CreateCheckpoint4(string &in asParent, string &in asChild, int alState)
{
CheckPoint("", "CheckPoint4", "", "DeathHints", "DeathHint4");
}