PSA: New animated face heads could break your scripts

The new heads that come with animated faces don’t have face decals.
If you have any scripts that assume the character’s head has a face, your script will error and break.

character.Head.face will error.

To fix use FindFirstChild to check for existence of the face decal:

if character.Head:FindFirstChild("face") then
4 Likes

This broke a custom camera script in my game which makes the character transparent for a custom 1st person view.

using FindFirstChild fixed my error.

1 Like

you can disable the animated faces in StarterPlayer by setting the EnableDynamicHeads property to Disabled

this can (apparently) increase preformance

1 Like

It should be opt-in by default.

But Roblox of course made it opt-out by default which sucks

2 Likes

what another good idea from roblox to make it opt-out, especially with the fact that it could lag games.
probably one of their ways of getting rid of the old simple blocky game we had a couple years ago

1 Like

You shouldn’t be assuming there’s a face at all anyway because exploiters can just delete their face too.

Do you think I want my script to support someone exploiting? Funny. If they are exploiting the game can break for them(its a local script), they deserve it.

But I do know its good practice to test for existence of an object before indexing it. But we can’t check everything all the time, that would be some serious code bloat.

1 Like

Doing that saves you from exploiters doing that. It isn’t supporting that at all. I don’t know where you got that. Assuming means there was no checks made for it.

If an exploiter removes their face and my localscript errors out for them, I don’t care about that. It won’t affect anyone else.

Good point, but I want to allow players to use them if they want.

Serious code bloat? It’s console bloat when they make the errors. I check for characters’ HumanoidRootPart when I need it for example, because exploiters can easily delete it. I’m talking from the server side though.

1 Like

I get what you’re saying, there are times when checking existence is important, well the point of this thread is that now, after the animated head update, checking a head for a face is important, it wasn’t before(in my case, maybe not in your case)