Need help with capture the flag game. welds not working

hello developers! recently, ive been working on a capture the flag game and i need it so whenever the person who has the flag dies, the flag drops so other people can take it. here is what i have so far:

picking up flag
image

on death
image

basically, the model that should teleport to the character’s humanoid root part whenever they die. instead, it only teleports the primary part of the model, which is the pole. here is how i have my welds set up:

image

here is the code for the flag respawning. this script is in the startercharacterscripts if that matters and it is a server script

local character = script.Parent
local player = game.Players:GetPlayerFromCharacter(character)

local blueflag = game.ReplicatedStorage.Assets.BlueFlagPickup
local redflag = game.ReplicatedStorage.Assets.RedFlagPickup

character.Humanoid.Died:Connect(function()
	if player.Stats.HoldingFlag.Value == true then
		player.Stats.HoldingFlag.Value = false
		if player.Team ~= "Blue" then
			local newflag = blueflag:Clone()
			newflag.Parent = workspace.FlagPickups
			newflag.PrimaryPart.CFrame = character.HumanoidRootPart.CFrame 
		end
	end
end)

if you know the answer to this, i would greatly appreciate it if you would comment and tell me because ive been stuck on this for a while. thank you!

From the screenshot you provided, it looks like the union for the flag is anchored. Anchored parts are not affected by welds, so make sure you unanchor the union and the hitbox before setting newFlag.PrimaryPart.CFrame.

1 Like

yes, both the union and the hitbox are anchored. when i un anchor then, the flag never gets cloned for some reason.

i figured it out! the script inside of the flag was interfering and deleting the flag right when it got teleported to the player. thank you for your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.