So, I have a gun that works perfectly on both the client and server, but I have an issue. I have a part with a script (server-side) that anchors whatever it touches. However, the position of the part when it gets anchored is different between the server and the client. On the server, the position is correct, but on the client, itβs different.
here a video to make it clear
4 Likes
are you moving the part from the client at the same time ?
well i send a remote event to the server to handle moving it and making some tween
here a part of the script of the gun
local direction = (PlayerMouse.Hit.Position - RayStart.Position).Unit * 32
local raycastResult = game.Workspace:Raycast(RayStart.Position,direction,raycastParams)
if raycastResult then
if raycastResult.Instance and raycastResult.Instance.Parent == game.Workspace.MoveAble then
if not Cooldown then
gui.Enabled = true
local hightlight = Instance.new("Highlight")
CurrentObjectInfo = raycastResult
hightlight.Parent = raycastResult.Instance
Debris:AddItem(hightlight,1)
ShootSound:Play()
Event:FireServer(raycastResult.Instance,tool,Character,nil)
β and the server handle moving it by giving it a BodyVelocity
Sounds similar to this
well tysm but i didnβt get it , it kinda different i guess
and why it happening in the first place both of the scripts are server side
so why that is happening?
1 Like