Best way to detect when a player hits a wall

Currently using a touched event at which point I fire a raycast in the direction of the player to check if theres a wall.

The objective I have in mind here is: when dashing if you make contact with a wall you grab onto it, I’ve tried a bunch of things but they either seem too sensitive or lacking at times. A runservice step seems to connect me to walls far away when flinging my camera despite the raycast only moving 1-3 studs out.

2 Likes

Try using workspace:GetPartBoundsInRadius() with a small radius starting from HumanoidRootPart every frame with RunService

4 Likes

Thank you! This works really well

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.