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:
- Open the provided place file in Studio.
- Play it.
- Observe the results.
Files
Engine - Avatar Head Material.rbxl (80.3 KB)