New "Enabled" Property for Scripts breaking our current BoolValue children

Reproduction Steps

Today, our game is experiencing a lot of bugs with systems we’ve never had to edit in the past few years. Specifically, we have a BoolValue object under a Script with the name “Enabled”.

Currently, when attempting to get the value associated with this BoolValue, we get an error stating “Attempt to index boolean with Value” using Script.Enabled.Value

It appears that this issue only occurs when you have a child living under a script with the name “Enabled”. This has not been an issue in the past and has only started happening today it seems.

Even checking the Properties for the Script object, there is no “Enabled” Property. Please can someone at Roblox revert whatever change was made so our game can still function.



Screenshot_3

The above images demonstrate the issue.

Expected Behavior

I expect that .Enabled will reference my BoolValue

Actual Behavior

An Error, “Attempt to index boolean with Value” due to a hidden Property of a Script called “Enabled”

Workaround

Not unless I go through our entire codebase to account for this sudden, unannounced change.

Issue Area: Engine
Issue Type: Other
Impact: High
Frequency: Constantly
Date First Experienced: 2022-08-30 00:08:00 (+01:00)
Date Last Experienced: 2022-08-30 00:08:00 (+01:00)

1 Like

This issue was caused by the latest version which was rolled out to servers today, not yet to clients and studio. The new version adds a Script.Enabled property that we were not expecting would cause an issue like this. We’re looking into this issue and what we can do.

In the mean time, it’s possible to work around this issue by replacing usages of .Enabled.Value with :FindFirstChild("Enabled").Value.

5 Likes

Thank you so much for the swift help!

I have implemented the change suggested and will be rolling out a patch now.

Yeah I’m sure this was pretty unexpected and to be honest our naming/indexing conventions should be improved to prevent situations like this.

Thank you so much for the help!

Royal

1 Like

No offence, but I feel like major changes like this (Enabled is a common word used for some instance names, at least especially for me) should be communicated before the update rolls out.

5 Likes

Uh is this undocumented new property just a negated version of the already-existing property Disabled?
Is there some additional difference???

Well disabled is a terrible name for a property so … it’s negated and also improved :slight_smile:

3 Likes

This is why I encourage accessing children through Instance:FindFirstChild exclusively. You don’t need to pay attention to announcements about new properties, you don’t need to consider likelihood a given name will ever be used as a property, and you don’t need to care about consistency. If more developers did this, it would help Roblox iterate faster.

I’d definitely like to see some convenient shorthand for only accessing a child sometime.

IIRC benchmarks have shown this to be slower than accessing instances via ‘.’

It also makes their code less efficient which in-cases where you use it often, can be detrimental.

2 Likes

This doesn’t matter. The actual performance concern with accessing a child is that the cost scales linearly with the number of children. Ideally you’re storing references to children instead of repeatedly indexing them, and using a dictionary where you need to optimize dynamic references to children in hot code.

For an object with 10,000 children, this is a comparison of one child access. An equivalent map lookup would take under 1 μs.

1 Like