Commit 36d68142 authored by Tanner Grehawick's avatar Tanner Grehawick

wall slide animation transitions

parent fe91af97
No preview for this file type
......@@ -23,6 +23,7 @@ public class Walk : AbstractBehavior {
Vector2 vel = body.velocity;
float wallState = Mathf.Abs(vel.x / speed);
animator.SetFloat("walk state", wallState);
animator.SetBool("is wall sliding", isWallSliding);
}
// Update is called once per frame
......@@ -140,11 +141,14 @@ public class Walk : AbstractBehavior {
Vector2 vel = body.velocity;
float hvel = vel.x;
if (isWallSliding) {
// NOTE:
// for some reason the animation for wall sliding is flipped (???)
// so i have to invert direction when wall sliding
if (collisionState.onWallLeft) {
inputState.direction = Directions.Right;
inputState.direction = Directions.Left;
}
else if (collisionState.onWallRight) {
inputState.direction = Directions.Left;
inputState.direction = Directions.Right;
}
}
else {
......
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