Fixed camera bug
This commit is contained in:
@@ -13,6 +13,7 @@ public class CameraController : MonoBehaviour
|
||||
public Transform player;
|
||||
public Transform pivot;
|
||||
public Vector3 offset;
|
||||
public Transform target;
|
||||
|
||||
void Start () {
|
||||
if(!useOffsetValues){
|
||||
@@ -20,7 +21,7 @@ public class CameraController : MonoBehaviour
|
||||
}
|
||||
|
||||
pivot.position = player.position;
|
||||
pivot.parent = null;
|
||||
pivot.parent = target.transform;
|
||||
|
||||
}
|
||||
|
||||
@@ -40,8 +41,8 @@ public class CameraController : MonoBehaviour
|
||||
controllerCamY = Input.GetAxisRaw("Right Stick Y") * (rotateSpeed * 200.0f) * Time.deltaTime;
|
||||
}
|
||||
|
||||
pivot.Rotate(0, mouseCamX, 0);
|
||||
pivot.Rotate(0, controllerCamX, 0);
|
||||
target.Rotate(0, mouseCamX, 0);
|
||||
target.Rotate(0, controllerCamX, 0);
|
||||
|
||||
if (invertY){
|
||||
pivot.Rotate(mouseCamY, 0, 0);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class FloorLevel : MonoBehaviour
|
||||
script.lives = 3;
|
||||
script.finished = false;
|
||||
respawn();
|
||||
script.pivot.transform.Rotate(0.0f, 225.0f, 0.0f, Space.Self);
|
||||
script.pivot.transform.Rotate(0.0f, 0.0f, 0.0f, Space.Self);
|
||||
levelBuild();
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class WaypointRace : MonoBehaviour
|
||||
script.lives = 3;
|
||||
script.finished = false;
|
||||
respawn();
|
||||
script.pivot.transform.Rotate(0.0f, 225.0f, 0.0f, Space.Self);
|
||||
script.pivot.transform.Rotate(0.0f, 0.0f, 0.0f, Space.Self);
|
||||
levelBuild();
|
||||
waypointPlacement();
|
||||
countdown = Time.time;
|
||||
|
||||
Reference in New Issue
Block a user