mirror of
https://github.com/PashaBibko/The-Mobius-Line.git
synced 2026-04-04 01:49:07 +00:00
Portals Actually Work
This commit is contained in:
@@ -49,8 +49,7 @@ public class PortalCamera : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called every frame
|
||||
void Update()
|
||||
void LateUpdate()
|
||||
{
|
||||
// Gets the offset of the player from the display portal
|
||||
Vector3 offset = m_DisplayPortal.PlayerOffset();
|
||||
@@ -63,8 +62,6 @@ public class PortalCamera : MonoBehaviour
|
||||
float angle = Quaternion.Angle(m_DisplayPortal.transform.parent.rotation, m_CapturePortal.transform.parent.rotation);
|
||||
Quaternion rotDif = Quaternion.AngleAxis(angle, Vector3.up);
|
||||
Vector3 newCamDir = rotDif * CameraController.Instance().transform.forward;
|
||||
//Vector3 d = new(m_CapturePortal.CamDif(), 0f, 0f);
|
||||
//Vector3 d = new(0f, 0f, m_CapturePortal.CamDif());
|
||||
Vector3 d = new(0f, m_CapturePortal.CamDif(), 0f);
|
||||
transform.parent.eulerAngles = Quaternion.LookRotation(newCamDir, Vector3.up).eulerAngles + m_Rot + d;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user