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

Rotation and Collision not replicating to client with CFrame?

Asked by 5 years ago

Why is this happening: https://gyazo.com/b0bac73946b607281f2d88dc462d25a7

The rotation of the object isn't showing up in the client.

Also this: https://gyazo.com/e204a11198315415ec7c90df1f2ab50d

The collision of the object isn't replicating to the client

Here's the code that deals with this, target is the object which is found with mouse.Target:

Server:

local Attach = Tool:WaitForChild("Attach")
function Activate(obj)
    obj = target
    obj.CFrame = Tool.Emitter.CFrame
end
Attach.OnServerEvent:Connect(Activate)

Client:

local Attach = Tool:WaitForChild("Attach")
game:GetService("RunService").RenderStepped:Connect(function()
    if target and target.Anchored == false and target:GetMass() < 250 and (target.Position - Tool.Emitter.Position).magnitude < 10 then
            Attach:FireServer()
            obj = target
        if obj then
            obj.CFrame = Tool.Emitter.CFrame
    end
    end
end)
0
Did you set the network ownership to a particular client? Vulkarin 581 — 5y
0
Nope I didn't use Network Ownership. ericvesper123 65 — 5y

Answer this question