Unable to reference anything in workspace with a local script

local part = workspace.testpart
If I use a local script, this returns an error, can someone explain to me why?
Fyi the local script is placed correctly under starter gui.

This was working fine before

local cam = workspace:FindFirstChild("testpart")
print(cam)

This also returns nil.

Infinite Yield only happens with WaitForChild, Are you sure this is the Correct Script? And are you sure the Item you’re looking for exists?

It returns Inf Yield if I do use waitforchild, forgot to specify that. My bad. Yes, the item I’m looking for already exists in workspace.

Well, Since it’s on a LocalScript, it is likely that it will taker a bit to load, which may be why you cant reference anything, try adding a Timeout:

local cam = workspace:WaitForChild("testpart", 10)
print(cam)

Can you try a simple loop check through workspace children?

local Workspace = workspace
for _,v in ipairs(Workspace:GetChildren()) do
   print(v.Name)
end

Still returns nil. Funny thing is if I try to reference the part the part itself disappears from workspace despite there being no script that deletes parts.

The part disappears if I start the game. The part is anchored and has can collide off, it is not getting destroyed by the void.

Have you tried checking for any scripts that destroy it?

I coded everything and I can confirm that there are no scripts that has :Destroy() in it or anything that would cause this issue

Alright, one more question does the part still exist when you playtest as server? (Run)

Check the Archivable Property. Are you sure thats enabled?

If its Disabled, it will Hide the Object

Archivable just means it can be cloned, i don’t think it’s related.

It does exist and archivable is on. Also as weakroblox35 said, archivable just means that it can be cloned and is somewhat irrelevant.

Irrelevant? after testing with a part, it hides the object, its nowhere located in workspace, as if it was Destroyed

Archivable is enabled anyways, I’m sure its not the root cause of the issue

You right, I was incorrect. What is the purpose of Archivable? - #2 by yourcomputerhasdied

So,

I have been testing and i cant seem to replicate your error,
Are you spelling the name Correctly?

No idea whats causing this but interestingly enough, some parts and models are not affected by this issue. I went to an empty baseplate and it works fine, I’m still trying to figure out what the issue is. Would if be helpful if I were to send a screen recording of everything?

Can you send us screenshots of all the children/properties of the part if any?

Also would help to try and disable certain Scripts in ServerScriptService to try and find the perpetrator.

EDIT: Is StreamingEnabled turned on?

Does the same happen on a server script?

1 Like