Tool that breaks items in front of player

I am trying to make survival game. I need to make mining system, currently I am using

plr:GetMouse().Target

In booga booga you can click anywhere on screen to mine something:

How I could make it too?

Thanks

That’s because they use the tool’s model as a hitbox. Most likely, they use the Basepart.Touched event.

1 Like

In booga there is custom tools, not normal tools but models that welds to players hand when equipped. I don’t think Soybeen would use that method

1 Like

I bet the game uses FindPartsInRegion3. Specifically, FindPartsInRegion3WithWhiteList, whitelisting only the hitbox and with a magnitude check to find which one is the closest mineral. All of that happens on the client, the server will then receive the mineral, do a magnitude check to prevent exploits then damage the mineral.

This isn’t about how tools are attached to the player, this is about hit detection. They could also be using raycasting, a looped magnitude check, or as mentioned by @Imaginalities, Region3.

I thought of region3. Also how you can do that with raycasting? I never used it

https://devforum.roblox.com/t/raycast-hitbox-401-for-all-your-melee-needs

1 Like

There are many ways
Some are:
1.Touching blocks
2.Raycasting

You can use raycasting to find a model in front of player

Or if your character is touching the model try character.HumanoidRootPart:GetTouchingParts()

1 Like

Now I think hitbox is best method. I should try it