I want to make that dragdetectors are handled on client side for optimization. what i know is that i need to check the RunLocally value and i need to update the position in a local script based on mouse position but how can i make the drag smoother like how it is on server, cause there u can change the dragstyle making it appear smoother.
#help with dragdetectors locally
1 messages · Page 1 of 1 (latest)
make the player as the network owner when they start dragging the part
local part = script.Parent.Parent
local dragDetector = part.DragDetector
dragDetector.DragStart:Connect(function(plr)
-- !!!
part:SetNetworkOwner(plr)
end)
** You are now Level 1! **
what? didnt know this was a thing, what does it do?
it makes the players handle the physics for the parts they own .. in other words they will have 0 ping while moving the part.
yo its me on my other account. So basically when i pick up a part with drag detector, it has 0 delay because it happens on client but it gets replicated on server too with this method right?
Yeah
just try the script and you'll see the difference.
yea i just tried u goated
is it good for performance too?
or should i try to make that the part gets replicated on server every like 15 frames
I don't think you can control when the parts get replicated ( easily* )
it's good for performance, even roblox use this method automatically when you touch unanchored parts