Ad
Log in to vote
0

Is there a difference between game.Workspace and Workspace.(name of child)?

Asked by
AltNature 169
3 years ago

I was wondering whether or not I could shorten my script a little using this but I'm unsure if there was a difference.

0
There isn't really much of a difference, but game.Workspace is the Workspace Service, while workspace is just a built-in variable assigned to game.Workspace Rare_tendo 2850 — 3y

2 answers

Log in to vote
-2
Answered by 3 years ago

There is not really a difference because workspace is like one of the main tabs (like starter player, server stoarage, etc) the only reason you would use "game" is so that your code will be able to find the workspace. So in conclusion the reason you should add game is because workspace is inside of your game

0
crypt has no idea what he's talking about.If I had enough rep, I'd downvote his answer soutpansa 120 — 3y
0
No, he is right. Workspace is under game. And so are the other services. workspace could mean anything, like it could be a reference to the Players service. User#19524 170 — 3y
0
Ha crypt100 20 — 3y
Ad
Log in to vote
4
Answered by
Mr_Unlucky 1085 Moderation Voter
3 years ago

There is no difference. It's recommended to use workspace however. Other options include:

game.Workspace
game:GetService("Workspace")
0
Where does it say it's recommended to use workspace over game.Workspace or game:GetService("Workspace") User#19524 170 — 3y
1
workspace is recommended because it helps save time typing. Mr_Unlucky 1085 — 3y

Answer this question