mirror of
https://github.com/PashaBibko/The-Mobius-Line.git
synced 2026-04-04 09:59:04 +00:00
Made first level IG
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user