Object names accept the new line character, resulting in minor issues

Explanation

Objects in the Explorer can have pretty much any name you want. This includes non-English characters (e.g. 日本語), and also includes special characters (◘, :recycle:, :star:). This behaviour is pretty much ideal, and, except for certain characters, functions correctly.

However, some minor issues occur when using the new line character (NOT \n, but the actual character / token) in the names of objects.

Among other issues.
The simplest fix is just to disable the ability to put the new character line in object names

Reproduction

  1. Obtain the character:
    1.1. Create / Open a script
    1.2. Press the Enter key a few times
    1.3. Click and hold from one blank line to the one above it. A blank, blue area should be visible.
    1.4. Press Ctrl+C or otherwise to copy the new line character
    1.5. Use Ctrl + V (or right click + Paste) to place the new line character wherever needed.
Second method to obtain the character

1.1. Run the following command in studio console: print("\n.\n.")
1.2. Place the mouse cursor to the left of the second period / dot.
1.3. Click and hold, dragging the cursor to the right of the first period / dot. (It will appear as though nothing is highlighted)
1.4. Press Ctrl+C (or right click + Copy) in order to copy the new line character to the clipboard
1.5 Use Ctrl + V (or right click + Paste) to place the new line character wherever needed.

  1. Select an object in explorer, and press F2 to modify the name (alternatively, go to the properties of the object and modify it there)
  2. Paste in the new line character, and observe the behaviour. (The new line will initially appear as if it is a space [" "])

Device Info

Operating System: Windows 10
CPU: Ryzen 5 3600
GPU: GTX 1650 Super
RAM: 16GB @ 3600MHz

2 Likes

Object names are strings, and strings can have new line characters. This is not a bug.

Unless… are you able to make new lines just by pressing enter or shift + enter, or ctrl + enter, or some other combination? If not, then yeah, this is not a bug.

Yes, they are strings. However, it is clear from the number of issues caused by having a new line in the name that the system has not been made with the new line character in mind.

Either:

  • The ability to put the new line character into the name is a bug, OR
  • There are a number of bugs related to the adding of a new line character into the name.

Either way, there is an issue.

1 Like

Thanks for the report! We’ll follow up when we have an update for you.

Wow you guys are fast compared to Roblox Support emails.

We figure that fixing this would be counterproductive:

  • In order to create an Instance with a multi-line name, you have to go out of your way to do so, Studio doesn’t give you an easy way to do this. Multi-line names aren’t really a supported thing.

  • We could strictly prevent entering multi-line names in the Roblox Studio UI. But that’s not desirable because taking away developers control to do this if they really need to for some reason isn’t necessary when the underlying engine supports that.

  • We could fix some of the display issues to make things look nicer. But that’s not desirable because then the UI is lying to you about what’s actually going on with the name. Since multi-line names are barely supported knowing that something weird is going on with the name is probably preferable.

The status quo isn’t great but it seems like the least bad option, we’re going to leave things as is unless something changes.

TL;DR: We can’t stop you from using them but please avoid multi-line names.

1 Like