Cant change mesh

i am currently making a boss battle whcih uses tweens as its form of movement (obviously has to be 1 part and cant be animated) so i thought of a way around this, mesh states that use animation.
but i get “script write restricted” when i try to change the mesh via script.
Code:
image

2 Likes

You aren’t able to change MeshId through a script. As a solution, you can have multiple meshes that are invisible and change their transparency to 0 when needed.

2 Likes

This is true for MeshParts. However, you can create a special mesh and parent it to a part. The reason is that the engine calculates all the collision data when the place loads, so once that happens, mesh parts are not allowed to change their meshes. But you can do it on a special mesh. Go figure.

2 Likes

Maybe, just maybe. You can check this and see if it works?

while true do
	task.wait(.3)
	script.Parent.MeshId = "rbxassetid://10296093025"
	task.wait(.3)
	script.Parent.MeshId = "rbxassetid://10296038848"
end