RemoteEvent is not sending Parts

Hello everyone reading this, the issue is:
I have been trying to send a part through a RemoteEvent from the server to the client, an example of how I try is this:

Script

local Part = Instance.new("Part")
Part.Parent = workspace
Part.Size = Vector3.new(50,200,50)
Part.CFrame = HumanoidRootPart.CFrame * CFrame.new(0,-65, -50 )
Part.Anchored = true
Part.CanCollide = false
Part.CastShadow = false
Part.Transparency = 0
local Event = ...
Event:FireClient(Player, Part)

Now, the event route is fine, the event is sent but when trying to access the part on the client, it is nil

LocalScript

local Event = ...
Event.OnClientEvent:Connect(function(Part)
	print(("The name is: %s"):format(Part.Name))
end)

This only happens when I try to access a variable with an Instance.new(), if it is for example a variable with a WaitForChild() or a FindFirstChild() it sends it normally

When using RemoteEvent or RemoteFunction, you should consider the limitations. The Part may not exist on the client (this is especially true if StreamingEnabled is on) when the server fires the Remote[Event/Function].

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.