If you use touch ended, it might be funky and your speed may flicker (and the player could just jump). Another way to do this is to check if a player is inside of a certain area. I randomly found this guide about this on script helpers here. Personally I haven't read too much of it, but it might help.
Edit: for an unrotated part, it's easy to tell if a player is in it. Assume p1 and p2 are two oppisite corners of the affected area.
lp = Vector3.new(math.min(p1.x, p2.x), math.min(p1.y, p2.y), math.min(p1.z, p2.z))
up = Vector3.new(math.max(p1.x, p2.x), math.max(p1.y, p2.y), math.max(p1.z, p2.z))
local function checkifinarea(point)
if (point.x>=lp.x and point.x<=mp.x) and (point.y>=lp.y and point.y<=mp.y) and (point.z>=lp.z and point.z<=mp.z) then
return true
else
return false
end
end
1 comment
soul sand lol