When changing the material of the avatar's head, it changes in the properties, but is not actually applied

Problem

In my game, I have a weapon that will petrify (turn to stone) a player when hit. Part of the immersive experience is to turn all the parts of the player’s character model to stone. This is done with the following code excerpt:

for _, item in ipairs(target.char:GetChildren()) do
	if item:IsA("BasePart") or item:IsA("UnionOperation") or
		item:IsA("MeshPart") or item:IsA("IntersectOperation") then
		item:SetAttribute("Color", item.BrickColor)
		item.Anchored = true
		item.Material = Enum.Material.Rock
		item.BrickColor = BrickColor.new("Flint")
	end
end

All the parts change material except the head. The head does change to the new color. I have tried a few things, including applying a SurfaceAppearance to no avail. I am not sure what is going on here, but it is happening in both Studio and the live server. One thing to note, SurfaceAppearance only seems to be applied to the front. It is not applied to any other surfaces.

It’s interesting to note that when attempting to apply a SurfaceAppearance to the head, an error prints out stating that “SurfaceAppearance can only be parented to MeshParts.” which is strange since the head is a mesh part as shown in the screenshot below.


Additional Information

Parameter Value
Problem Area Engine
Problem Component Avatar - Head
First Noticed 14 July 2024
Priority Normal
Impact Medium
Annoyance Level High
Place ID 15112688736
Game ID 5207881632

The beta features that I have enabled are as follows:

  • Assistant Preview
  • Material Generator
  • Material Picker
  • Texture Generator

As for plugins, I have a bunch that are installed, but very few are enabled. The ones that are enabled are listed below with links to their details page on the Roblox store website:

Although the game and place Ids of the development place have been provided, this also occurs on a blank baseplate which is attached below.


Expectations

What I expect to happen is that when changing the material of the head, the actual material is applied to the head and not just the property.


Visuals

The below screenshot was taken during my attempt to use SurfaceAppearance to change the head material, which did not work. As can be seen, the error message was printed regarding parenting the SurfaceAppearance instance to the character’s head.

This screenshot does not use the SurfaceAppearance so the color change is visible.


Reproduction

To reproduce the issue, perform the following steps:

  1. Open the provided place file in Studio.
  2. Play it.
  3. Observe the results.

Files

Engine - Avatar Head Material.rbxl (80.3 KB)

3 Likes

MeshPart and PartOperations all inherit from BasePart so only the first check is needed.


This has been a bug for more years, and upon contacting one of the engineers a while ago upon experiencing a similar bug, they said that this is the way Head works with Humanoids. Although I prefer to find this a bug. For my game, I ended up cloning the head and replacing it with a fake one, while keeping the real head invisible. It fixes more issues that way.

1 Like

SpecialMeshes like Head just appear as SmoothPlastic.
As @SomeFedoraGuy said, just replace them with MeshParts.

2 Likes

Well, if they are saying that’s the way it works, then perhaps it’s time to change how it works. Strange the head is singled out though. I see no reason for this deficiency. Unless there’s some weird technical issue, this is to just make the developer’s life harder.

I did what you suggested and it’s working. But the problem is that you shouldn’t have to do that. Also a tip is you multiply the size by 1.05 to slightly increase the head a little bit so it hides the real head.

3 Likes

Head is no longer a SpecialMesh as shown in one of the pictures OP posted, it is a MeshPart.

So it is a bit odd that it acts differently from a regular MeshPart, Humanoid seems to be overwriting it in some way, since removing Humanoid will allow you to change the Material.

Edit: Forgot to mention that R6 still has a SpecialMesh for the Head but OP was posting a R15 model where the head is a MeshPart.

2 Likes

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

4 Likes