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

How to stop projectiles without delay?

Asked by
Turgon 80
6 years ago

I have a script which shoots a projectile towards the mouse position alongside a player animation. What i want is for the projectile to stop (anchor) when it hits something. At first i added velocity to the projectile to move it and the movement was pretty smooth. But there seems to be a big delay in movement across the client that created it and the other clients/server. When i anchor the part from either the clients local script or if i put a normal script inside the projectile, it anchors at different locations. In the client that created it its usually on the ground or deep in the ground because late detection. On other clients its usually in the air. So i tried moving the projectile by adding a script into it and using Heartbeat to move it with cframe. The anchoring works and its in sync across clients but the movement is extremely jaggy because of the speed it needs to have. Basically, im stuck and have no idea how to make a projectile that can do this. Any ideas?

0
You are talking about lag, http://wiki.roblox.com/index.php?title=Fighting_Lag User#5423 17 — 6y
0
That doesn' really help me. I don't even have filtering enabled. Turgon 80 — 6y
0
How about using a "RocketPropulsion" for the required velocity and fire the ReachedTarget() RblxSignal when it reaches the point or target? arshad145 392 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

You can log what the projectile's cframe is when it "stops" then bring it back to that cframe when you anchor it. Just a thought, idk if thats what you are looking for.

0
That would work but 2 problems: 1. The touched event seems to have a delay when the part has been newly created. If i shoot the projectile somewhere close it'll only detect touched when its deep inside. If i send it a long distance it actually works. 2. On other clients it'll be in midair and suddenly teleport to the ground. Turgon 80 — 6y
Ad

Answer this question