Added to waypoint race script so waypoint is moved to a new location if player falls off 3 times (only current workaround if waypoint is inaccessible)

This commit is contained in:
Gregory Campbell
2020-02-02 20:55:11 -05:00
parent 83c299b9aa
commit f874f7fcd0
+11
View File
@@ -39,6 +39,7 @@ public class WaypointRace : MonoBehaviour
script = player.GetComponent<PlayerController>();
size = 2;
level = 1;
script.lives = 3;
script.finished = false;
respawn();
script.pivot.transform.Rotate(0.0f, 225.0f, 0.0f, Space.Self);
@@ -56,6 +57,7 @@ public class WaypointRace : MonoBehaviour
{
waypointPlacement();
script.lives = 3;
level++;
if(level > 3)
{
@@ -74,9 +76,18 @@ public class WaypointRace : MonoBehaviour
if(script.respawn == true)
{
respawn();
script.lives--;
script.respawn = false;
}
if(script.lives == 0)
{
script.lives = 3;
waypointPlacement();
}
if(countdown + completionTime < Time.time)
{