How do I detect if the player is in air

how would I detect if the player is in the air and not touching other block

2 Likes

A long raycast perhaps? Ah. A raycast that that is as long as the player’s jump height.

1 Like

I already tried ray casts they don’t work with my rigged character because it keeps detecting the limbs

1 Like

Alright then. You could use a NOR gate to ignore all but the limbs? @JR01 summoning.

1 Like

Collisions and Nor blocks???

1 Like

I think raycast and nor blocks

1 Like

I already try doing that but the collision is not constantly running so the nor always give outputs even if im on the ground

2 Likes

Oh ok then

1 Like

Have the ray casts selected on the ground, it only activates if it hits the ground, not the player.

2 Likes

Make an empty parent object and set that to all ground objects, use a raycast to search for the ground parent and misses will mean you’re in the air.

3 Likes


That will fix your jumping. When the “Miss” output is active that means the player is not touching the ground is that what you’re looking for? If you need any more help feel free to ask, I’m always happy to help. (Length of the ray is 48 because that is the smallest possible it can be and hit the ground, the angle is 90 so it points at the ground) :llama:

2 Likes

Ive done this but it’s not efficient because if you had multiple ground blocks you have to have multiple raycasts.

1 Like

Make it so their parent is the ground object, like what JR_01 said.

1 Like

Yeah thats what i’m doing right now. So I create a new block and make the new blocks it’s parent?

1 Like

When you make a new block, have it’s parent be the “Floor” object

Now my character is falling through the floor

1 Like

Is the character solid? or is the floor not? I’ll check the code real fast

Never mind i refreshed and its normal

1 Like

bug i guess

1 Like

When i do this it only allows this to happen to only 1 block though I would like to have different ground blocks

1 Like