Made first level IG

This commit is contained in:
2025-04-25 14:46:41 +01:00
parent 06010f27ef
commit f803d0ed83
18 changed files with 6813 additions and 9 deletions

View File

@@ -23,8 +23,8 @@ public partial class PlayerMovement : MonoBehaviour
{ m_State = PlayerState.SLIDING; }
// Checks if the player is in the wall running state
else if (GetNormalOfClosestCollider(out m_WallNormal) && m_WallRunKeyPressed)
{ m_State = PlayerState.WALL_RUNNING; }
// else if (GetNormalOfClosestCollider(out m_WallNormal) && m_WallRunKeyPressed)
// { m_State = PlayerState.WALL_RUNNING; }
// Defaults to ruuning
else { m_State = PlayerState.RUNNING; }

View File

@@ -7,9 +7,11 @@ public partial class PlayerMovement : MonoBehaviour
private void UpdateInput()
{
// Calls get axis raw to ignore any uneeded scaling
m_Input.x = Input.GetAxisRaw("Horizontal");
//m_Input.x = Input.GetAxisRaw("Horizontal");
m_Input.y = Input.GetAxisRaw("Vertical");
m_Input.y = Mathf.Clamp(m_Input.y, 0, Mathf.Infinity);
// Updates key press states
m_JumpKeyPressed = Input.GetKey(m_JumpKey);
m_SlidingKeyPressed = Input.GetKey(m_SlideKey);

View File

@@ -8,8 +8,14 @@ public partial class PlayerMovement : MonoBehaviour
Collider closest = null;
foreach (Collider collision in m_WallCollisions)
{
Vector3 pos = collision.ClosestPoint(transform.position);
{
Vector3 pos = Vector3.zero;
if (collision.GetType() != typeof(MeshCollider))
{
pos = collision.ClosestPoint(transform.position);
}
Vector3 dif = transform.position - pos;
float distance = dif.magnitude;