Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Should i do this or that?

I'm trying to make a miner game and with not much knowledge on which is better. I've decided to ask a question. So whats best to make a pickaxe use? so when you mine a rock it detects if its near the player and if we can mine it or not.

QUESTION: Is using Mouse.Target == 'Rock' good for this pickaxe or touch event?

4 comments

1

Personally, I'd use magnitude and mouse.Target.Name.

1

Target is going to be a part and not a string. If you want to get the name of Target then write Target.Name.

1

Bereza eh?

0

Yes, I'm inspired by Berezaa thats why. But I just wanna see if i at least do it.

1 answer

✓ Accepted answer

It depends.
It's your choice

Are you using it as a tool which you can swing? What's your position on it needing to touch the rock? If it should at least look like it's touching the rock, you should do well to use Touched and check the name of the object you hit. If it's not a necessity, and input is more important to rely on, then mouse.Target.Name will provide a suitable value to check against (In conjunction with the magnitude of the difference in positions)

This discussion is preserved as it was. New answers, comments, and votes are closed.