TeleportService's Name is not the same as the ClassName

Reproduction Steps

  • Open up studio with the “Show Hidden Objects in explorer” enabled.
  • Open any game, including a baseplate.
  • Scroll down the explorer until you get to “Teleport Service”
  • Observe the name and ClassName of the object once clicked

Expected Behavior
I expect the Name and ClassName to follow the same convention as every other service on Roblox where there is no space.

Actual Behavior
image

There is a space present between the word Teleport and Service.

While this is normally extremely minor within the scope of studio, for any developer working in Remodel where they are checking against through the game file or other similar tools, can produce abnormalities that shouldn’t be down to the creators to fix.

Workaround
If you are using code which checks if X is a service, just remove any spaces.

Issue Area: Engine
Issue Type: Other
Impact: Moderate
Frequency: Sometimes

5 Likes

This isn’t a bug. RunService’s name is also different than its class name. They are named such because of compatibility. Old scripts that may not use the DataModel:GetService method would break if they were updated to their class names. In other words, legacy scripts that use game[“Run Service”] or game[“Teleport Service”] to index those services would fail and break compatibility.

3 Likes

RunService and TeleportService represents two services which doesn’t follow the convention of every single service ever in Roblox. I still believe it remains a bug.

This isn’t even talking about how TimerService, ScriptService and LuaWebService are all considered instances and not the name of the service.

If absolutely required Roblox can support both formats but use the correct formatting moving forward, theoretically every single Roblox file is very slightly larger because of such an issue.

2 Likes

I understand your reasoning and I agree that it makes sense to change the names to follow the modern service naming conventions. However this is not a bug, and should be moved to #feature-requests:engine-features instead.

From what I can recall, RunService was one of the first (maybe the first?) service exposed to developers following the XService naming convention. Before that all we had were services such as Workspace, Lighting, Players, Teams, etc. They hadn’t settled on a naming convention and the consequences of that are that today some early services that remain have spaces in their names. Adding in detection to convert requests with spaces in their name introduces overhead and unnecessary hacks into the engine. It is up to developers to work around the constraints of the engine, even if they don’t necessarily make sense.

2 Likes

It’s a poor historical choice, but it’s not a bug. There’s too much existing code where people rely on the services having these names to change it unfortunately.

The good news is, that this is why game:GetService("...") exists. That’s the way you should be getting services, because it’s guaranteed to always return you a valid instance of the service, even if it didn’t exist yet or someone renamed it.

Getting services by writing game.ServiceName is not a good idea, because services technically don’t exist until you ask for them with game:GetService("..."). Indexing them by name relies on code having previously run that already did correctly create them with game:GetService("..."). For some services such as RunService / UserInputService the game engine so heavily relies on them that they’re always going to be there regardless, but for other more obscure services they technically could not exist yet when you ask for them by name.

19 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.