im new to game development and i have seen people using . in their scripts what does it mean?
The period on roblox is used to represent the ancestry between classes and instances on studio. The way ancestry works is that if a an instance such as a part belongs in a type of folder or class (for eg: workspace), the part in which the class it is becomes the parent and the instance is the child of that class. So let us say I put a part in a folder called Bricks in the workspace. Because the part is inside the bricks folder, that folder becomes the parent of the part. This, by default will consider the part the child of the folder since it is inside it. Using the same logic, we can deduce that since the folder is in workspace; the parent of it is the workspace as the folder belongs to the workspace; and the folder becomes the child of workspace.
for example
--Let us break it down. --Start with the parent. game.Workspace --Now insert a part into the workspace, game.Workspace.Part --This tells us that workspace is the child of game, and the parent of workspace is game. This also tells us that Part is inside the workspace class and is the child of it; opposing that is the workspace being the parent of the part. --Now to sum things up, I added a folder in the workspace called bricks; using the same logic we can track down this part with our knowledge. game.Workspace.bricks --That is it.
It separates out things. So this would be what it could be used for.
game.Workspace.Part.Name = "Hello"
What the (.) is doing is splitting the code. Its telling the code that the part that you want to change the name is in the "Game, then the Workspace, PartSelected then the property name and then the name you want it to be.
Closed as Not Constructive by Goulstem
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?