Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Parts Freeze While In Mid Air?

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.

2 comments

0

Is there a script that automatically anchors parts?

0

*A lag-remover script?

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.