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

Parts Freeze While In Mid Air?

Asked by 4 years ago
Edited 4 years ago

I was testing the exploding parts for my brickbattle game but this happened while testing, they also unfreeze when i move close to them, anyone know how to fix this? https://imgur.com/a/RflGWk4, sorry for the lag.

0
Is there a script that automatically anchors parts? 2b2tpvp 17 — 4y
0
*A lag-remover script? 2b2tpvp 17 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

The problem is likely to do with NetworkOwnership. Roblox physics need an "Owner" of the part in order for the physics engine to work properly. Whoever 'owns' the part will be responsible for doing the physics calculations on their computer. Parts automatically change owners behind the scenes whenever the user gets close, and we can also set the ownership manually via the "SetNetworkOwner" method.

-- Insert this in the projectile script:
function onPartHit(part)
    --...lines of code
    part:SetNetworkOwner(player); --Set the owner to the person who shot the projectile
    wait(10);
    part:SetNetworkOwnershipAuto(); --Give ownership back to the server 
    --There are better ways to set the ownership back, but I will leave that up to you.
end

For more information about NetworkOwnership, check out this article: https://developer.roblox.com/en-us/articles/Network-Ownership

Ad

Answer this question