Null check on current state drawGizmos

This commit is contained in:
Soulaha Balde 2022-04-02 10:47:46 -04:00
parent d0d51a82f1
commit 41e7ddfd48

View File

@ -30,7 +30,7 @@ public class PlayerMovement : MonoBehaviour {
SwitchState(newState);
}
void OnDrawGizmos() => currentState.OnDrawGizmos();
void OnDrawGizmos() => currentState?.OnDrawGizmos();
public void OnMove(InputAction.CallbackContext ctx) {
moveDirection = ctx.ReadValue<Vector2>();