Inverted player death direction
Cause Unity Transform was bugging out
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user