So first of all i have already look up if someone else has made a topic or video about this and i have found no information about it so im asking if by any chance anyone knows or has an idea on how to detect if the player is off the ground and presses a key to do a dropkick.
First you should try detecting the input first. Once the input has been pressed it can fire code that will check if they’re in the air or not.
You can use the UserInputService.InputBegan
event to connect your dropkicking code.
UserInputService | Documentation - Roblox Creator Hub
The function you connect should also determine if the player is in the air or not before attempting any of the dropkick code. We don’t want to loop over checking the player’s “in-the-air” status since that’s unnecessary and resource-intensive.
Use the Humanoid:GetState()
function to get the local player’s current humanoid state. If it’s not Enum.HumanoidStateType.Jumping
or Enum.HumanoidStateType.Falling
then they’re most likely not in the air.
Humanoid | Documentation - Roblox Creator Hub
Thanks i will try using the Humanoid.StateType in some tests and i will tell you if i get it right!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.