Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Should i do this or that?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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?

1
Personally, I'd use magnitude and mouse.Target.Name. theCJarmy7 1293 — 8y
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. 1waffle1 2908 — 8y
1
Bereza eh? TheDeadlyPanther 2460 — 8y
0
Yes, I'm inspired by Berezaa thats why. But I just wanna see if i at least do it. UltraUnitMode 419 — 8y

1 answer

Log in to vote
2
Answered by 8 years ago

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)

Ad

Answer this question