Fixed portals

Minor visual bugs but I cba to fix them
This commit is contained in:
2025-04-25 09:47:22 +01:00
parent aa9e69a7ec
commit 06010f27ef
2 changed files with 14 additions and 2 deletions

View File

@@ -6158,6 +6158,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4470023418895194988, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_PortalB
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4470023418895194988, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_PlayerTag
value: Player
@@ -12067,6 +12071,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4470023418895194988, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_PortalB
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4470023418895194988, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_PlayerTag
value: Player
@@ -12132,6 +12140,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4470023418895194988, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_PortalB
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4470023418895194988, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_PlayerTag
value: Player

View File

@@ -4,6 +4,7 @@ public class PortalManager : MonoBehaviour
{
[Header("References")]
[SerializeField] GameObject m_OtherPortal;
[SerializeField] float m_AngleDif;
[Header("Set References")]
[SerializeField] GameObject m_CameraPrefab;
@@ -69,8 +70,7 @@ public class PortalManager : MonoBehaviour
if (PlayerMovement.CanGoThroughPortals() && s_TeleportedThisFrame == true)
{
// Rotates the player
float rotDif = -Quaternion.Angle(transform.rotation, m_OtherManager.transform.rotation);
rotDif += 180.0f;
float rotDif = -Quaternion.Angle(transform.rotation, m_OtherManager.transform.rotation) + m_AngleDif;
CameraController.Instance().RotatePlayerDirection(new Vector2(0f, rotDif));
// Tellss the player it went through a portal