It's (mostly) impossible to edit the .TextureID property

It is impossible for me to edit the .TextureID (or .TextureId) property/properties of a MeshPart, or other kind of mesh.
This is primarily because:

  1. .TextureID is a read-only value (why this is, i have no idea.)
  2. No one knows how else to do it.

This only happens when using scripts (client or server, doesn’t matter.) to modify TextureID or TextureContent
The TextureID property will be updated, but the texture wont actually load onto the MeshPart

Expected behavior

What should happen is that the texture should be loaded onto the MeshPart as the script is using the standardised "rbxassetid://123456" method. However, this does not happen, no matter which method I try.
Not even the assistant (Assistant | Documentation) could help, or even other tools like ChatGPT or Google Gemini.

I’ve seen this done in other games however the way it is done is absolutely benign to me.
I hope this is changed for the better.

A private message is associated with this bug report

2 Likes

Hello,

I can see the texture correctly loading and displayed. Are you still experiencing the issue?

for i, v:MeshPart in workspace:GetChildren() do
	if not v:IsA("MeshPart") then continue end
	
	v.TextureID = "rbxassetid://2794593"
end

Hello,

The assetId you’re testing with (rbxassetid://137174656473889) isn’t a texture, it points to a Decal asset. I looked up the textureId set on this decal asset and found this id: rbxassetid://121052180406921.
If you rerun your test place with this assetId you can see the script works as expected, which was also illustrated in the previous reply.
Furthermore, the documentation mentions that you can change TextureId during runtime and it is not read-only:

Note that the MeshPart.MeshId property cannot be changed during runtime but the texture can. See TextureContent for details.