Tool - Hammer smashing spheres

Situation:

  • I created a mesh called “Hammer”.
  • I am spawning randomly spheres (parts).

Goal #1:
I want to create a Tool (Hammer) that can be picked up within the game.

Problem:
I don’t know how I can achieve the “pickup” of the Hammer.
What functions or tools do I need to use that the “Player” can pickup the Hammer by pressing “E” and dropping the Hammer by pressing “E” again?

Goal #2:
Once the Hammer is picked up by the player, I want to make sure, that the Hammer can smash the spheres (parts), which are randomly spawning.

Problem:
I can’t find any documentation that would cover the “smashing” or “killing” of the spheres.
How can I get this done?

@documentation:
I was studying the documentation about the “tools”. But the documentation doesn’t cover the basics for my two goals outlined above.

thank you soooo much for any little thoughts, hints, advice and help how to get this done.
appreciate it, :hugs:

1 Like

For the pickup feature, I suggest taking a look at this Proximity Prompts | Documentation - Roblox Creator Hub

You would use this feature to have the tool placed inside your backpack.

For the so call “smashing” or “killing” of the sphere, I suggest looking into this Instance | Documentation - Roblox Creator Hub

1 Like

insert a click detector and connect a function that destroys the hammer, gives tool to player or maybe touched event etc.

You can use solid-modeling tools if your sphere is not a mesh part, if it is, just destroy the circle and spawn parts or mesh parts. For now simply you can use functions like getpartinbounds etc. to get spheres in front of the player when player activates the tool and break it.

1 Like

I pretty much agree with the people here but like if you don’t know anything about coding or just new to it/learning. I suggest for you to look at videos as it is more organized than reading it on devhub. Depends on you tho ,goodluck doing that?

2 Likes