diff --git a/src/ingame/player.gd b/src/ingame/player.gd index 1f1694c..1c34198 100644 --- a/src/ingame/player.gd +++ b/src/ingame/player.gd @@ -118,10 +118,12 @@ func hold_thing(p_item_instance_id: int) -> void: # TODO: in more complex scenarios model scene might want to have its own callback for this. for model in base_node.get_children(): for submodel in model.get_children(): - var material := submodel.mesh.surface_get_material(0).duplicate() as Material + var mesh := submodel.mesh.duplicate() as Mesh + var material := mesh.surface_get_material(0).duplicate() material.render_priority += 1 material.no_depth_test = true - submodel.mesh.surface_set_material(0, material) + mesh.surface_set_material(0, material) + submodel.mesh = mesh @rpc("any_peer", "call_local", "reliable") func throw_thing() -> void: