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

how would you make an explosion that damage depends on range?

Asked by 4 years ago
Edited 4 years ago

I might be thinking of doing some type of part raycast, but I want to know if there is a more simpler way to make this type of concept. I've seen it in other games and I wanted to give it a try.

1 answer

Log in to vote
1
Answered by
royaltoe 5144 Moderation Voter Community Moderator
4 years ago

You can check a distance using magnitude:

magnitude = (first parts position - second part's position).magnitude

Based on that number value, you can determine how big you want your explosion.

AetherProgrammer was talking about his tutorial he made for it about an hour ago - https://forum.scriptinghelpers.org/topic/763/how-magnitude-works-in-layman-s-terms

0
thx speedyfox66 237 — 4y
Ad

Answer this question