New Content Property on TextObjects

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

Roblox automatically adds camelCase versions of all APIs, as far as I know. You may want to check that your solution actually works.

1 Like

Unprofessional company since this type of situation occurs way too frequently where a breaking change is made with not enough beforehand mention. There needs to be adjustments in management if there’s ever going to be change.

4 Likes

Thanks for your feedback. We posted about this as we are concerned about whether there are functional breakage of games caused by this release. With respect of community opinions, we will revert this change in the next release and find a better property name with announcement in advance. Thanks.

81 Likes

Y’all really getting mad over updates. Like be happy were getting more updates for UI.

Your really getting mad over a update you can easily fix yourself in less than a 2 minute period.
No need to get pressed over this now.

4 Likes

The point is, it’s unnecessary breaking with no warning.

21 Likes

It’s not fun having to go and change things for any number of scripts several times over each time related update gets released.

That’s not why people are angry. Updates to the platform are important, but forewarning regarding updates to developers to ensure games don’t break as a result of them is equally if not more important. Adequate forewarning is all we ask for.

While this may be applicable to you and your circumstances, on larger scaled projects or for other scripters this may be far from true. What you’re describing is a best case scenario, which, given the extremely general nature of the name “Content” as it applies to this situation, is anything but best case.

10 Likes

Developers aren’t going to “be happy” over an out of the blue, unannounced update that’ll cause problems for their games just because it’s a new update for UI.

Your really getting mad over a update you can easily fix yourself in less than a 2 minute period.
No need to get pressed over this now.

Also, bigger games with more advanced UI will take far longer than 2 minutes to change if they used “Content” for a lot of their assets. Just because it’ll be quick for you, that doesn’t mean it won’t be inconvenient and time consuming for others.

4 Likes

Why not just name the property TextContent?

7 Likes

This post is dismissive of the reason why developers are upset with the naming property, please read posts before making comments like this. Roblox could easily avoid this breaking change by using better, more descriptive names instead of generic names that are widely used by developers for UI children.

It’s good that our feedback has been considered and a better property name will be used for the update, but it’s not enough for this to happen one time. Critical auditing of property naming choice as well as community input needs to be taken before implementing changes.

We have a legitimate reason to get upset about the property’s name change. Don’t be dismissive.

11 Likes

Why did you ping everyone? Just out of curiosity.

3 Likes

Does Instance[“Child”] function the same as Instance.Child?

It doesn’t really make sense for me to never use indexing especially since sometimes I need to go down a long heirarchy to find a certain part and it would be very performance taxing or at least annoying to do :FindFirstChild() over and over.

I’m glad Roblox is reverting this update though since it’s the 3rd time they’ve done something like this with absolutely no warning and content is such a generic term that it’s easy for someone who doesn’t know better to not understand this.

2 Likes