Using ReadVoxels to detect terrain

I’m trying to use ReadVoxels() to detect whether there is terrain below the player or not.

Backstory
This is because I have a script that teleports a player then generates terrain beneath them, but some laggy players may not generate it at all so they’ll just fall through the map and die. To counter this I decided to anchor the player until terrain was detected but I don’t know how exactly to do it. I’ve also looked at raycasting but some people said that ReadVoxels() was more efficient. Any ideas?

In summary, I need to know how I can use ReadVoxels() to detect terrain (sand) beneath a player.

1 Like

No, a single raycast is definitely more efficient here. Just shoot a raycast down from the player that is whitelisted to workspace.Terrain

Alright I’ll look into raycasting and try it. I’ll get back to you when I’m done.