Commit 8bfb0f0a authored by Tanner Grehawick's avatar Tanner Grehawick

double jump fix

parent 5c8d5847
......@@ -3121,8 +3121,8 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1055150054}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 5, y: -3, z: 0}
m_LocalScale: {x: 5, y: 1, z: 1}
m_LocalPosition: {x: 6.5, y: -2.45, z: 0}
m_LocalScale: {x: 8.0012245, y: 2.0874004, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
......@@ -3683,8 +3683,8 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1774567343}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.65, y: 0.2, z: 0}
m_LocalScale: {x: 6.449178, y: 7.164482, z: 1}
m_LocalPosition: {x: -5.52, y: 0.2, z: 0}
m_LocalScale: {x: 4.7093396, y: 7.164482, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
......
......@@ -33,6 +33,10 @@ public class Jump : AbstractBehavior {
}
jumpState = Mathf.Sqrt(jumpState);
animator.SetFloat("jump state", jumpState);
// reset air jumps when on ground
if (collisionState.onGround) {
airJumpsMade = 0;
}
}
void FixedUpdate() {
......@@ -45,7 +49,6 @@ public class Jump : AbstractBehavior {
public void Activate() {
if (collisionState.onGround) {
// ground jump
airJumpsMade = 0;
Vector2 vel = body.velocity;
vel.y = GetJumpVelocity(jumpHeight);
body.velocity = vel;
......
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