How and where do I assign this variable?
Google isn’t helping me at all
Thanks for any advice. Sorry if it’s a dumb question
private enum MovementState { idle, running, jumping, falling }
private void UpdateAnimationState()
{
MovementState state;
if (rb.velocity.y > .1f)
{
state = MovementState.jumping;
}
else if (rb.velocity.y > -.1f)
{
state = MovementState.falling;
}
animator.SetInteger("state", (int)state);
}