Not sure what you mean by “on the air,” but I’m assuming you mean whether or not a player is on the ground / in the air
Unfortunately raycasting may be one of the easier methods of doing this.
A raycast only needs two basic variables to begin using–
If your custom movement doesn’t involve a rotating character (as though it were in outer space), then your direction could easily be
local direction = Vector3.new(0,-10,0)
--Fill in the -10 with ( half the height of the root part + a few studs to give it room to "see" )
This direction would raycast downwards on the Y axis.
If your character rotates, you can use the root part (HumanoidRootPart if you’re using the standard character) to find which direction is currently “down.” (Not too familiar with CFrame so could use some help with this)
If raycast returns objects, then it is likely the player is not on air, if the function returns nil, then the player likely is on air.
–If you’re a dev seeing this and find errors, feel free to correct me; I’m still learning and am open to new ideas–
Actually Roblox has a built in property into the humanoid of a player called “FloorMaterial” when the players feet aren’t touching anything it will turn the value to “Air” as documented which will help detect if they are off the ground. Read more here: Humanoid.FloorMaterial