/// <summary> /// does euler physics each tick /// </summary> void Update() { if (Time.deltaTime > .25f) { return; //lag spike quit early } MovementHorizontal(); VerticalMovement(); transform.position += velocity * Time.deltaTime; aabb.RecalAABB(); isGrounded = false; }
public void ApplyFix(Vector3 fix) { transform.position += fix; if (fix.y > 0) { isGrounded = true; } if (fix.y != 0) { velocity.y = 0; } if (fix.x != 0) { velocity.x = 0; } aabb.RecalAABB(); }