Hello,
I’ve been fighting with this issue the whole day and I’m at a loss.
To explain what’s basically happening:
• I call a player’s ability to spawn a medkit interactable.
• The medkit interactable tells every client to load a model into the interactable part.
• The locally spawned model gets all its properties set to not collide at all, and then gets welded into the interactable part.
This should be it, but for some reason, some models just locally move the interactable part to themselves.
Example of the issue: 2023-01-22 20-08-34
Codes:
--- LOAD LOCAL MODEL
local module = function(modelName, toParent:Part, toNickname)
local success, model = fetchLocalModelInfo(modelName);
if (success) then
local clone = model:Clone();
local main = clone.PrimaryPart;
---
setModelProperties(clone, {
collision_group = "RenderModels";
--- can_collide = false, anchored = false, can_query = false, can_touch = false;
}, true);
weldAll(clone);
--- THIS IS THE ISSUE PART
weldParts(toParent, main, main, nil, false, false);
---
clone.Name = toNickname or modelName;
clone.Parent = toParent;
return clone;
end;
end;
--- WELD PARTS FUNCTION
local module = function(primary:Part, secondary:Part, weldParent:Folder, weldType, inverse, inheritProperties)
if not (isWeldable(primary) and isWeldable(secondary)) then
return;
end;
---
local weld;
local weldTypes = {"Weld", "Motor6D", "WeldConstraint"};
if (weldType and table.find(weldTypes, weldType)) then
weld = Instance.new(weldType);
else
weld = Instance.new("Weld");
end;
---
weld.Part0 = primary;
weld.Part1 = secondary;
if (inverse) then
weld.C0 = primary.CFrame:Inverse();
weld.C1 = secondary.CFrame:Inverse();
end;
if (inheritProperties) then
local inheritedProperties = getPartProperties(primary);
applyPartProperties(secondary, inheritedProperties, true);
end;
weld.Name = primary.Name..">"..secondary.Name;
weld.Parent = weldParent;
return weld;
end;