Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The correct way to check if a character is grounded #4

Open
maxwellodri opened this issue Mar 22, 2023 · 4 comments
Open

The correct way to check if a character is grounded #4

maxwellodri opened this issue Mar 22, 2023 · 4 comments

Comments

@maxwellodri
Copy link

I've been checking whether the jump_velocity in the TnuaPlatformerAnimatingOutput is Some but not 100% sure if this correct.

@idanarye
Copy link
Owner

Yes - this is correct. At least to the point that if it doesn't hold for a certain case you can open a bug for it.

@diego411
Copy link

diego411 commented Mar 3, 2024

@idanarye Would the new way to do this be to check whether get_count_mut of TnuaSimpleAirActionsCounter is Some?

@idanarye
Copy link
Owner

idanarye commented Mar 3, 2024

@diego411 No. The new way is to use controller.is_airborne. The air actions counter will probably give you the same information, but:

  • It's a hassle to set up (especially if you don't already use it for air actions)
  • It will make the intentions of the code less clear.
  • If you want to switch to a different air counter, you'll have to change the code that checks for groundedness.

@diego411
Copy link

diego411 commented Mar 3, 2024

@idanarye Thank you! Idk how i missed that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants