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

Accurate ways of destroying a projectile?

Asked by 4 years ago

I have several projectiles and I want to be able to specify magnitude for how far they should travel before being destroyed. Right now I'm calculating the time it would take them to travel a distance and supplying it to debris service. Is there any other way to do this? I'm concerned that because of latency or lag or other problems that may arise, the real time the projectile is in the air would be inaccurate.

I'm thinking of doing a loop check for the projectile to compute distance from origin until it passes the max distance, but this seems pretty expensive especially with multiple projectiles. Any ideas for this would be appreciated.

1
use renderstepped to calculate (every frame) how far away it is with magnitude, and use an if statement to see if it is as far as you want. then if it is, use part:Destroy (part is whatever part is the projectile.) if3q 6 — 4y
0
@if3p is right.. thats the right way User#23252 26 — 4y

Answer this question