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:
@@ -39,6 +39,7 @@ public class WaypointRace : MonoBehaviour
|
|||||||
script = player.GetComponent<PlayerController>();
|
script = player.GetComponent<PlayerController>();
|
||||||
size = 2;
|
size = 2;
|
||||||
level = 1;
|
level = 1;
|
||||||
|
script.lives = 3;
|
||||||
script.finished = false;
|
script.finished = false;
|
||||||
respawn();
|
respawn();
|
||||||
script.pivot.transform.Rotate(0.0f, 225.0f, 0.0f, Space.Self);
|
script.pivot.transform.Rotate(0.0f, 225.0f, 0.0f, Space.Self);
|
||||||
@@ -56,6 +57,7 @@ public class WaypointRace : MonoBehaviour
|
|||||||
{
|
{
|
||||||
|
|
||||||
waypointPlacement();
|
waypointPlacement();
|
||||||
|
script.lives = 3;
|
||||||
level++;
|
level++;
|
||||||
if(level > 3)
|
if(level > 3)
|
||||||
{
|
{
|
||||||
@@ -74,9 +76,18 @@ public class WaypointRace : MonoBehaviour
|
|||||||
if(script.respawn == true)
|
if(script.respawn == true)
|
||||||
{
|
{
|
||||||
respawn();
|
respawn();
|
||||||
|
script.lives--;
|
||||||
script.respawn = false;
|
script.respawn = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(script.lives == 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
script.lives = 3;
|
||||||
|
waypointPlacement();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if(countdown + completionTime < Time.time)
|
if(countdown + completionTime < Time.time)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user