how can i check if the player is on the edge of an building “a part”?
im trying to make a system to give you an speed boost when you jump off from a build by the edge and i have no idea of how to do it, can someone help me?
like
if player jump and player is in the edge then
add an body force to the player
end
i only dont know how to check the edge, the rest i know
I think @bura1414 idea works, and it ask for less resources than any others I could think. Touch event is not cool I know…
But, reading Region3? Raycasting downwards on a loop? Bulding size magnitude check on a loop?
I think invisible parts at the edge for touching event could work
If each building is a model, you could do it by script on CommandBar, by just iterating each building, and finding its edges to add a part that fits the size of each side of the edges
@arthur11223344556688 In that way you can add the invisible parts for touch event in all your buildings, as @bura1414 suggested its an acceptable approach
You cant check if the player is near the edge if you are not using a loop or RunService to check with a raycast or region3…
That approach is for placing the invisible walls on all edges of your buildings, so player trigger touch event and then you can give them the boost…
its not a loop, its to check when the player jump, i once did an script to check if theres a wall behind the player with lookvector can it be used here? like checking if theres something below the player and if theres nothing below but a bit forward
Sure, when player is jumping, do a raycast downwards maybe (obviously using lookVector or something that aims the player’s facing) to check if the player is at the edge, then boost.
But you will be relying on jump action from the client I guess, which sounds worst than the invisible walls at the edges to allow or not a player to have the boost