FindFirstChild returns nil when needed

I’m have a folder of all my “gameobjects” in the workspace. When I make a new gameobject I have a script that figures out what type of gameobject it is by figuring out if it has a part named a certain name.

My issue is that when I use:
elseif newGameObject:FindFirstChild(".coreBuilding") then
it returns nil. But, when I use:
elseif newGameObject:WaitForChild(".coreBuilding") then
it returns the part named .coreBuilding as it should. But I can’t use WaitForChild because there is a chance that the new model won’t have the identifier .coreBuilding! So there is a chance it could wait indefinitely.

What do I do?

Why not just use CollectionService | Roblox Creator Documentation to find out what type of instance it is?

Currently it seems like a replication issue if it needs to wait for the .core building part to load in inside the model.

CollectionService doesn’t have this issue because the moment the model with the collection service tag is sent to the client, it will have the tag associated with the model. This is similar with attributes though attributes doesn’t have cool functions like :GetTagged which collection services keeps track of.

1 Like