Sending a model through a remote event

This code USED to work, but something was changed in the past year that broke this code.

Server-side, I am sending a model through FireClient:

tycoonAnimation:FireClient(player, model)

On the LocalScript, I am trying to get the children of the model:

model:GetChildren()

However, it ONLY gets other models within the model. It does not get BaseParts. Is this a limitation of remote events or a bug?

Use :GetDescendants() instead.

:GetChildren() only gets the first things inside the model, :GetDescendants() gets everything inside it

1 Like

GetDescendants vs GetChildren is not the problem. I’m aware of the differences and have tried it already.

Can you show us your Model and its descendants, and the script you’re using GetChildren on, not had this issue.

Sure, but I don’t think it will help. This is not a syntax error.

example

for i, part in pairs(model:GetChildren()) do
    if part:IsA("BasePart") then
        print("base")
    elseif part:IsA("Model") then
        print("model")
    end
end

I have a lot of different models I use this for, the above screenshot is just an example.

Podium will print “model”, but Gate Monitor and Gate Monitor Support will never print “base”. It does not transfer BaseParts for some reason.

Finally figured it out.

Right before the FireClient, I was moving the model to a different part in the workspace. The FireClient was so fast that it was going BEFORE the model actually moved.

1 Like