What is Workspace "Workspace"?

Hello people of the Devforum. Today while I was scripting a loading UI, I came across a error that I haven’t seen before (I’ve also just gotten into scripting so that could be why). Anyways I looked it up online but I didn’t see any information about it. So that’s why I am making this post.

The error pops up when I try and manipulate the normal camera, it says

MenuCamera is not a valid member of Workspace "Workspace"

Screenshot_79
Here it is pictured above

Screenshot_80
More information about the code is pictured above

The thing is, this code works on my separate testing place so I’m not sure why it doesn’t here. Anyways thanks!

1 Like

Workspace is the class type, "Workspace" is the name.

Your MenuCamera isn’t in workspace.

1 Like

It is though… That’s why I am so confused.
Screenshot_81

I’m assuming this is a loading screen? Most likely the issue is this script executes before the game has finished loading so the instances in the workspace have not yet loaded.

Create your instance in that script instead of trying to reference the instance in the workspace.

2 Likes

Ohhhh that makes sense, should I bump up the wait time then?

Nevermind it worked, thanks! And again sorry I am just learning LUA.

You could but I wouldn’t recommend it since it doesn’t dynamically fit your loading time. Because this is a loading screen I wouldn’t even reference a part for the Camera’s position. Manually copy the CFrame of the menu part and assign the camera to that.

1 Like