New Content Property on TextObjects

Update:

Per your feedback, please note that we will be reverting this change in the next release.

Original Post:

Dear developers,

We recently added a new property named Content on Text objects. With this change, your games could be affected if they have a child named Content parented under text objects and scripts use the TextParent.Content syntax to access them.

If you have a game that is affected by this, you can perform a quick fix by doing the following:

  • Search your code by pressing ctrl+shift+f
  • Replace instances of .Content with :FindFirstChild(“Content”)

We apologize for not giving advance notice, and are looking to improve our process in the future. If you were affected by this, please let us know by replying in this thread.

114 Likes

This topic was automatically opened after 14 minutes.

Isn’t this the third time this has happened in just a few months? I appreciate the warning but it’s really not very helpful without a grace period for us to fix our games, not to mention there are tons of games that aren’t maintained anymore. It’s one thing if it’s a really complex property, but “Content” is extremely general and very applicable to a lot of UI designs. I know I’ve used it for sure in multiple projects. Isn’t there a more precise property name that can be used that not only doesn’t break as many scripts, but also gives the developer a better idea of what the property actually does?

One year at RDC, Roblox gave a pledge to backwards compatibility, but this isn’t really supporting that goal. There needs to be some kind of system to prevent these issues as they only seem to become more and more frequent. I shouldn’t have to come back to a project that’s only a year or two old to patch it back into a working state.

110 Likes

Hey. I have a question.

What does this new property do? Does it refer to an external text asset? Or is it part of the rich text formatting feature that you guys are working on? Or does it serve a different function altogether?

16 Likes

This TextObject property could just as easily have been TextContent or PlainText or RenderedText or a million other names that would be more descriptive than Content and yet less breaking.

Why does Roblox keep implementing breaking changes when they are so easily avoidable?
Content isn’t even a good name. It’s very ambiguous. It’s a very general name, which is why devs use it for their UI components!

The pivot property is for internal studio tool use only so I don’t understand why it isn’t given some internal name so it won’t affect developers.
The body physics properties was resolved, but shouldn’t have been done that way to begin with.

What is the decision making process behind all these? Giving us heads up is not enough- these changes should not be done this way at all, regardless of how much warning time you give.

193 Likes

Please stop giving surprise updates over and over, given the response on another previous thread you shouldn’t have continued to give out these surprise updates.

23 Likes

Is it too late to roll back and call it TextContent? This is much less likely to collide, is more specific and is consistent with other text related properties.

Naming for new API members needs to go through more intensive audit.

43 Likes

I feel the term Content could be confusing since that term usually refers to the Content Data Type, such as rbxassetid://123456 — unless i’m misunderstanding the purpose of the feature.

10 Likes

I tested this and it seems to be a property to get plain text from rich text.

2 Likes

So, you’re saying that I must go through all my UI related scripts and change the name of everything that falls under a Text Object named Content…Seriously.

3 Likes

While it’s good a post was made to notify developers I can’t help but feel it should have been done a lot sooner, especially with something which very well could effect a LOT of games with a common word such as “Content”. When rolling out changes like this you should always give Developers TIME to change these things BEFORE you roll them out to avoid as much downtime for games as possible. This isn’t the first time this has happened and sadly I’m sure it wont be the last.

Please Roblox, ensure your Developers are given the appropriate time to react to these changes and make the necessary changes.

2 Likes

Well this will break some stuff for sure. If you want to quickly select all ‘Content’ items in your StarterGui that are under these text UI instances, here’s a quick snippet you can run in the command bar:

game:GetService("Selection"):Set({})
for _,v in ipairs(game.StarterGui:GetDescendants()) do
	if (v:IsA("TextLabel") or v:IsA("TextButton") or v:IsA("TextBox")) then
		local content = v:FindFirstChild("Content")
		if (content) then
			game:GetService("Selection"):Add({content})
		end
	end
end
33 Likes

I’m not one who usually likes to repeat what’s already been said, but this is just beyond frustrating. .Content is just so vague yet so commonly used, there are so many better terms you could have called it that wouldn’t break a lot of things. TextContent? RawContent? This isn’t the first time. The next time something like this comes up, can your team look into other names as well? I truly think this headache could me adverted if a bit more time was spent thinking it though.

Just my 2¢ at least.

4 Likes

I’m starting to notice a trend of new properties being added that conflict with names that are often used by developers for children. This has happened with Pivot, BodyAngularVelocity (which was thankfully renamed to AssemblyAngularVelocity) and now Content. I think it’s time to start using FindFirstChild in place of the index operator when getting children, and I’ve already replaced code in the game I’m currently working on to only use FindFirstChild for all children.
The name Content also doesn’t really explain what the property is actually for. It could be confused with the Text property.

In my opinion allowing developers to use the index operator to get children was a bad idea, but that ship has already sailed.

8 Likes

The problem with using ::FindFirstChild versus normal indexing is there’s overhead with the former.

This already makes it a second-choice option for a lot of devs if we’re able to guarantee an objects existence beforehand.

9 Likes

Note replacing all uses of .Content does not guarantee you’re game will be fixed.

Referencing instances via

TextObject[“Content”]

will also break following this update.

3 Likes

So instead of giving us an advanced warning like you did here; you went and ahead and shipped it?

Sounds like there’s a process and it just wasn’t followed.

7 Likes

Not sure if this is the best place to ask but what is the content property used for. I’m on my phone do its hard to search on the dev hub if I could get any links or a quick explanation, Thanks.

This is getting repetitive and rather frequent in recent months.

I understand the frustration of this, this is one of the reasons I started using lowercase names for everything so if something gets added/renamed it doesn’t break stuff.

1 Like