mirror of
https://github.com/PashaBibko/The-Mobius-Line.git
synced 2026-04-03 17:39:03 +00:00
Added wall riding section
This commit is contained in:
@@ -110,7 +110,7 @@ Camera:
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
far clip plane: 100
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -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; }
|
||||
|
||||
@@ -9,17 +9,17 @@ public partial class PlayerMovement : MonoBehaviour
|
||||
|
||||
foreach (Collider collision in m_WallCollisions)
|
||||
{
|
||||
Vector3 pos = Vector3.zero;
|
||||
float distance = Mathf.Infinity;
|
||||
|
||||
if (collision.GetType() != typeof(MeshCollider))
|
||||
{
|
||||
pos = collision.ClosestPoint(transform.position);
|
||||
Vector3 pos = collision.ClosestPoint(transform.position);
|
||||
|
||||
Vector3 dif = transform.position - pos;
|
||||
|
||||
distance = dif.magnitude;
|
||||
}
|
||||
|
||||
Vector3 dif = transform.position - pos;
|
||||
|
||||
float distance = dif.magnitude;
|
||||
|
||||
dist = Mathf.Min(dist, distance);
|
||||
|
||||
if (dist == distance)
|
||||
|
||||
Reference in New Issue
Block a user