i want to make a minecraft-like crouching system. when the player is crouching, how do i make it so that they can’t fall off parts?
1 Like
Ooh this sounds interesting! Ill give you a basic idea on how you could probably do it:
First we need to see IF the player IS on the edge of a part. To do this I suppose you can use raycasts pointed downwards and then from there get the part belows edge. To get an edge you basically do:
local part = -- path to part
local edge = part.CFrame*CFrame.new(part.Size.X/2,part.Size.Y/2,0)
You can do the thing above to roughly calculate what edge the player is on and how close the player is to it.
Second yea I have no idea about this part… Sorry.
1 Like