|
|
@ -72,7 +72,7 @@ public class RacetrackGameMode : GameMode |
|
|
|
Vector3 xAvgPos = new Vector3(xAvg, 0.0f, 0.0f); |
|
|
|
Vector3 xAvgVP = Camera.main.WorldToViewportPoint(xAvgPos); |
|
|
|
|
|
|
|
Debug.Log("xAvgPos = " + xAvgPos + ", xAvgVP = " + xAvgVP); |
|
|
|
//Debug.Log("xAvgPos = " + xAvgPos + ", xAvgVP = " + xAvgVP);
|
|
|
|
|
|
|
|
//We move the camera forward by at least one increment
|
|
|
|
//Keep doing it until the average x-position is roughly centred
|
|
|
@ -81,7 +81,7 @@ public class RacetrackGameMode : GameMode |
|
|
|
Camera.main.transform.Translate(scrollSpeed, 0, 0, Space.World); |
|
|
|
xAvgVP = Camera.main.WorldToViewportPoint(xAvgPos); |
|
|
|
|
|
|
|
Debug.Log("Camera = " + Camera.main.transform.position + ", xAvgVP = " + xAvgVP); |
|
|
|
//Debug.Log("Camera = " + Camera.main.transform.position + ", xAvgVP = " + xAvgVP);
|
|
|
|
} while (xAvgVP.x > 0.5f || xAvgVP.y > 0.5f); |
|
|
|
|
|
|
|
//If the foremost player is off the screen, scroll forward to catch up with them
|
|
|
|