How to limit max range of mouse.hit

Like : if mouse.hit at the void or the sky normally it will print like alot of number but i want to limit that to 100

Forget about Mouse.Hit. Do Raycasts. They’re better. I think there’s a option to setup a range for it.

Generally, you should avoid using Mouse.Hit for new work as it has been superseded by UserInputService and ContextActionService.

For more information on how to use Raycasting and UserInputService to get the mouse position, I would check out this tutorial on the documentation website:
Hit Detection with Lasers | Documentation - Roblox Creator Hub

1 Like

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