Welding a target character to my own character makes it so i cant move, why?

Im trying to make a script where if i press on you, i can take u like ‘hostage’, so i tried welding using motor6d the character i press on, and it doesnt work for some reason, i just cant move at all

code:

if Hitbox.Reference.Value ~= Character then
						local TargetChar :Model = Hitbox.Reference.Value
						local TargetRootPart :BasePart = TargetChar.HumanoidRootPart
						local TargetHuman : Humanoid = TargetChar.Humanoid
						
						if CollectionService:HasTag(TargetChar, "HitBy"..userId) then
							return
						end
						CollectionService:AddTag(TargetChar, "HitBy"..userId)
						
						task.delay(1, function()
							CollectionService:RemoveTag(TargetChar, "HitBy"..userId)
						end)
						
						CollectionService:AddTag(TargetChar, "WasGrabbed")
						
						for i, v in ipairs(TargetChar:GetChildren()) do
							if v:IsA("BasePart") then
								v.CanCollide = false	
								v.Anchored = false
								v.Massless = true
							end
						end
						
						TargetHuman:ChangeState(Enum.HumanoidStateType.Physics)
						
						local motor6d = Instance.new("Motor6D")
						motor6d.Part0 = RootPart
						motor6d.Part1 = TargetRootPart
						motor6d.C0 = CFrame.new(0,0,-2)
						motor6d.Parent = TargetRootPart
						
						
					end

i even set cancollide and anchored and masless correctly and it still doesnt work

1 Like

Did you set NetworkOwnership to Character?

well in thecode i didnt, what do i set the network ownership to?

SetNetworkOwner(player) – the player who is the hostage. Just to make sure I’ll check.

and what am i setting its network owner, target humanoid root part or what

The more I think about it, I know the player owns what’s welded to them by default, but since it’s another player with a network owner, I’m gonna assume it has to deal with Ownership. So I could be wrong.

Anyways, like this in Server. And just to be clear player is getting the ownership.

hostage.PrimaryPart:SetNetworkOwner(player)

It’s not working still, im unable to walk and idk why.

giving a part networkowner basically allow a player to replicate what ever is done to the part to the server . Since character are being moved by the client , the player must have networkownership or the update of the movements will be super low

oh yeah! I thought it was simulating physics to client or owner smoother.

Its not working properly, i really dont know why??

Scratch the Ownership, sorry about that. Try Setting Humanoid.PlatformStand = true This will make the player have no Control.

1 Like

Awesome, it works now, thank you so much!!!

2 Likes

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