I was making a mechanic in my game that requires a mesh to be welded to a union in order to function properly. The problem is, the mesh isn’t welding to the union. I have a script that moves the Union to a set position, and the Union does move there. However, the mesh stays where it was and doesn’t move. I did make sure that all the items were unanchored, did make sure the weld had part0 and part1 to respective parts, did also make sure it was enabled.
Oh. I see. Do you add the weld before moving the union? When you move the position of the union, it might be breaking the weld. Try checking it in game if the weld is still there.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local Teams = game:GetService("Teams")
local Players = game:GetService("Players")
local QueueFolder = ReplicatedStorage:WaitForChild("Queue")
local QueuedPlayers = QueueFolder:WaitForChild("Players")
local InGamePlayers = QueueFolder:WaitForChild("In-Game")
local QueueChange = QueueFolder:WaitForChild("QueueChange")
local QueueTime = QueueFolder:WaitForChild("QueueTime")
local ChangeCam = QueueFolder:WaitForChild("ChangeCam")
local SpecConfirm = QueueFolder:WaitForChild("SpecConfirm")
local MiscEvents = ReplicatedStorage:WaitForChild("MiscEvents")
local Objective = MiscEvents:WaitForChild("ObjMessage")
local BombExploded = MiscEvents:WaitForChild("BombExploded")
local BombDefused = MiscEvents:WaitForChild("BombDefused")
local MessageClient = MiscEvents:WaitForChild("Msg")
local LoadoutStorage = ServerStorage:WaitForChild("LoadoutStorage")
local ModelStorage = ReplicatedStorage:WaitForChild("ModelStorage")
local CBox = ModelStorage:WaitForChild("ContrabandBox")
local RaidCops = Teams:WaitForChild("Raid Cops")
local Defenders = Teams:WaitForChild("Defenders")
local Map = game:GetService("Workspace"):WaitForChild("House")
local TIME_BETWEEN_QUEUE = 15
local CURRENT_TIME = 15
local IN_ROUND = false
local ROUND_MAX_TIME = 120
local CURRENT_ROUND_TIME = 120
local PLAYERS_NEEDED_FOR_START = 1
local BoxLocations = {
Map:WaitForChild("BoxSpawn1").Position,
Map:WaitForChild("BoxSpawn2").Position
}
QueueChange.OnServerEvent:Connect(function(plr, todo)
if todo == "Join" then
local newFolder = Instance.new("Folder")
newFolder.Name = plr.Name
newFolder.Parent = QueuedPlayers
elseif todo == "Leave" then
local findfolder = QueuedPlayers:FindFirstChild(plr.Name)
if findfolder then
findfolder:Destroy()
end
else
plr:Kick("Unexpected Client behavior detected.")
end
end)
SpecConfirm.OnServerEvent:Connect(function(plr)
if IN_ROUND == true then
SpecConfirm:FireClient(plr, true)
elseif IN_ROUND == false then
SpecConfirm:FireClient(plr, false)
end
end)
while task.wait(1) and IN_ROUND == false do
CURRENT_TIME -= 1
if CURRENT_TIME == 0 and IN_ROUND == false then
if #QueuedPlayers:GetChildren() >= PLAYERS_NEEDED_FOR_START then
IN_ROUND = true
QueueTime:FireAllClients(CURRENT_TIME, IN_ROUND)
local SWITCH_TEAM = true
for i, player in ipairs(QueuedPlayers:GetChildren()) do
SWITCH_TEAM = not SWITCH_TEAM
player.Parent = InGamePlayers
local RealPlayer = Players:WaitForChild(player.Name)
local Char = RealPlayer.Character
local Loadout = RealPlayer:WaitForChild("PlayerGui"):WaitForChild("Loadout")
local Primary = Loadout:WaitForChild("Primary")
local Secondary = Loadout:WaitForChild("Secondary")
local WeaponPrime = LoadoutStorage:WaitForChild("Primaries"):WaitForChild(Primary.Value):Clone()
WeaponPrime.Parent = RealPlayer.Backpack
local WeaponSecond = LoadoutStorage:WaitForChild("Secondaries"):WaitForChild(Secondary.Value):Clone()
WeaponSecond.Parent = RealPlayer.Backpack
BoxClone = CBox:Clone()
BoxClone.Parent = workspace
BoxClone.Position = BoxLocations[math.random(1, #BoxLocations)]
if SWITCH_TEAM == true then
RealPlayer.Team = Defenders
local DefenceSpawn = Map:WaitForChild("DefenceSpawn")
Char:MoveTo(DefenceSpawn.Position)
Objective:FireClient(RealPlayer ,"Defend the house from the raiders. Protect the assets at all costs. Location has been provided.", false)
elseif SWITCH_TEAM == false then
RealPlayer.Team = RaidCops
local RaidSpawn = Map:WaitForChild("RaiderSpawn")
Char:MoveTo(RaidSpawn.Position)
Objective:FireClient(RealPlayer ,"Find and destroy the contraband in the house. Eliminate any threats.", false)
end
ChangeCam:FireClient(RealPlayer, Enum.CameraType.Custom)
end
while task.wait(1) and IN_ROUND == true do
CURRENT_ROUND_TIME -= 1
if CURRENT_ROUND_TIME == 0 and runloop then
IN_ROUND = false
for i, ingameplayer in ipairs(InGamePlayers:GetChildren()) do
local RealPlayer = Players:WaitForChild(ingameplayer.Name)
ingameplayer.Parent = QueuedPlayers
for i, tool in ipairs(RealPlayer.Backpack:GetChildren()) do
tool:Destroy()
end
if RealPlayer.Character:FindFirstChildWhichIsA("Tool") then
local FoundTool = RealPlayer.Character:FindFirstChildWhichIsA("Tool")
RealPlayer.Character.Humanoid:UnequipTools()
FoundTool:Destroy()
end
if RealPlayer.Team == Defenders then
Objective:FireClient(RealPlayer, "", true)
end
RealPlayer.Team = Teams:WaitForChild("Neutral")
ChangeCam:FireClient(RealPlayer, Enum.CameraType.Scriptable)
end
game:GetService("Workspace"):FindFirstChild("ContrabandBox"):Destroy()
CURRENT_ROUND_TIME = ROUND_MAX_TIME
CURRENT_TIME = TIME_BETWEEN_QUEUE
QueueTime:FireAllClients(CURRENT_TIME, IN_ROUND)
end
end
elseif #QueuedPlayers:GetChildren() <= 1 then
CURRENT_TIME = TIME_BETWEEN_QUEUE
end
end
QueueTime:FireAllClients(CURRENT_TIME, IN_ROUND)
end
BombExploded.Event:Connect(function()
print("explosion")
IN_ROUND = false
CURRENT_ROUND_TIME = ROUND_MAX_TIME
CURRENT_TIME = TIME_BETWEEN_QUEUE
MessageClient:FireAllClients("Contraband was successfully destroyed.")
end)
BombDefused.Event:Connect(function()
print("defusion")
IN_ROUND = false
CURRENT_ROUND_TIME = ROUND_MAX_TIME
CURRENT_TIME = TIME_BETWEEN_QUEUE
MessageClient:FireAllClients("Threats to assets were eliminated.")
end)
Oh. I attempted to recreate your problem and I think it may be because you are changing the Position instead of the CFrame. My weld doesn’t work when I change the position but it does when I change the Cframe of the part instead.