Commit a5328612 by Philipp Adolf

Remove unused fields in PlayerController

parent a8cee5b3
......@@ -6,8 +6,6 @@ using GamepadInput;
public class PlayerControl : MonoBehaviour
{
private Rigidbody2D body2D;
private Vector3 lastPos; // we make sure the last Pos is never the curPos.
private Vector2 moveDirection;
public Transform groundCheck;
public LayerMask mask;
......@@ -87,10 +85,6 @@ public class PlayerControl : MonoBehaviour
void FixedUpdate()
{
//Update last position:
lastPos = transform.position;
if (isGrounded())
velocity.y = 0;
......@@ -163,10 +157,6 @@ public class PlayerControl : MonoBehaviour
//finally set the velocity:
body2D.velocity = velocity + currentPushSpeed;
//update move direction after the currentposition was updated:
moveDirection = (transform.position - lastPos).normalized;
}
private bool isGrounded()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment