Attaching custom meshes to players

Hi, I’ve recently ran into an issue when trying to attach custom meshes to players.

I’ve recently created a custom helicopter hat system which constrains a Part to the players’ Head through a HingeConstraint. All I used for that was Instance.new('Part') and changed the size, etc.

I’m now looking at making a jetpack system, and want to attach a custom Mesh to a players torso through a WeldConstraint. Below is my current code. It’s inside ServerScriptService so can show to all clients.

	player.CharacterAdded:Connect(function(character)
		local torso = character:WaitForChild('UpperTorso')
		local jetpack = Instance.new('MeshPart')
		jetpack.MeshId = 'rbxassetid://18922176303'
		
		local weld = Instance.new('WeldConstraint')
		weld.Part0 = jetpack
		weld.Part1 = torso
		weld.Parent = jetpack
	end)
end)

Expected Behaviour
The mesh welds to the players back displays my custom model.

Reality
Received this error:

What have I tried?
I’ve looked at cloning meshes from ReplicatedStorage but can’t seem to figure it out. I’ve also tried using SpecialMeshes but can’t figure these out either, even after reading the documentation.

I’d be grateful for any help I can get!

1 Like

I’m assuming you’re trying to modify the MeshPart.MeshId property.
I’m pretty sure that you cannot change that property, at least not during runtime, since this is what the documentation says:
*
Content ID of the mesh that is displayed on the MeshPart.

Note that this property currently cannot be changed by scripts as the collision model of the mesh
cannot be recomputed during runtime. See InsertService:CreateMeshPartAsync() as a method to
create a new MeshPart from a given MeshId and with a specified CollisionFidelity and RenderFidelity.
*

1 Like

Yeah, I’ve seen this too. Just looking for any workaround really and what I could do differently.

i think you can change SpecialMeshes during runtime

Why not store this mesh in ReplicatedStorage and clone it when needed?

1 Like

i think

1 Like