Inverted player death direction

Cause Unity Transform was bugging out
This commit is contained in:
Pasha Bibko
2025-11-25 11:31:51 +00:00
parent 561594d123
commit 4f3aab0a36
3 changed files with 8 additions and 6 deletions

View File

@@ -162,6 +162,7 @@ MonoBehaviour:
m_Behaviour: {fileID: 0}
m_SpinSpeed: 0
m_Renderer: {fileID: 104400500}
m_Transform: {fileID: 104400498}
--- !u!4 &104400498
Transform:
m_ObjectHideFlags: 0

View File

@@ -19,5 +19,5 @@ public class GlobalOrbitalSettings : MonoBehaviour
[SerializeField] GameObject m_EnemyPrefab;
public static GameObject EnemyPrefab => Instance.m_EnemyPrefab;
void Start() => Instance = this;
private void Start() => Instance = this;
}

View File

@@ -7,8 +7,8 @@ public class PlayerController : OrbitalPositionBehaviour
public static void AttachPlayer() { s_Instance.m_OrbitalPosition.m_IsAttachedToRings = true; }
private Vector3 m_SuicidePoint;
private bool m_KillingItself = false;
private float m_DeathLerp = 0f;
private bool m_KillingItself;
private float m_DeathLerp;
public MeshRenderer m_Renderer;
@@ -31,10 +31,9 @@ public class PlayerController : OrbitalPositionBehaviour
if (!m_KillingItself)
return;
transform.position = Vector3.Lerp(m_SuicidePoint, Vector3.zero, m_DeathLerp);
transform.position = Vector3.Lerp(m_SuicidePoint, m_SuicidePoint.normalized * 20f, m_DeathLerp);
m_DeathLerp += Time.deltaTime;
}
public override void OnCollision(OrbitalPositionBehaviour other)
@@ -52,6 +51,8 @@ public class PlayerController : OrbitalPositionBehaviour
{
m_KillingItself = false;
m_Renderer.enabled = true;
m_Renderer.material.color = Color.green;
}
public override void OnReachCentre()