This is very tricky, so listen carefully.
I have made a system where if you get super low on health, you get knocked down and ragdolled.
People can then pick you up and carry you around, as well as throw you anywhere they want.
The thing is, when you pick someone up, his UpperTorso gets welded to your UpperTorso and it somehow messes with the network ownership in a bad way. You will either get network ownership of both your character and the character you’re carrying, or the character you are carrying will get network ownership of your character (same goes for the server). This makes it so unpleasant to watch yourself getting carried, you and your camera are going to do the snappy-wobble (???) and the character that carries you is going to twitch and tilt rapidly, as well as losing his animations, making it really bad. So, I wanted to give the ownership of the ragdoll to the server so everybody gets a nice sight of what is happening, but I could not do that because of the weld.
Example:
Carrier’s view:
Ragdoll’s view:
Is there any way to fix this? If so, I am all ears.
You can call SetNetworkOwner() on all BaseParts in the parent model, I believe.
local Character = workspace.Player
for _,d in pairs(Character:GetDescendants()) do
if d:IsA('BasePart') then
d:SetNetworkOwner(game.Players.NewOwner)
end
end
Obviously, don’t use the preset variables.
To undo, do:
local Character = workspace.Player
for _,d in pairs(Character:GetDescendants()) do
if d:IsA('BasePart') then
d:SetNetworkOwner(nil)
end
end
Oh and a biggie, this can ONLY BE CALLED BY THE SERVER.
This is what I did from the very beginning, in fact.
if v:IsA("BasePart") then
game.PhysicsService:SetPartCollisionGroup(v,"Ragdoll")
end
end
for _,v in pairs(targ.Parent:GetDescendants()) do
if v:IsA("BasePart") and v.Name ~= "UpperTorso" then
v:SetNetworkOwner(nil)
end
end
for _,v in pairs(plr.Character:GetDescendants()) do
if v:IsA("BasePart") then
game.PhysicsService:SetPartCollisionGroup(v,"Carrier")
v:SetNetworkOwner(plr)
end
end
If I do that, it will set both players’s ownership to server. That means that there will be severe input lag for the carrier, meaning that it is not an option. Remember that the characters are welded.
I’ve been looking through my older code and found that SetNetworkOwner(nil) worked exactly the same as SetNetworkOwnershipAuto(). This is not to say that your way is more ideal, just that my way wasn’t necessarily “incorrect”.
@Weldify Might I suggest in addition to setting network ownership to the other player that you also weld the players together? It might work.
I just realised when I reread the description. Maybe try setting the ragdolled player’s character’s network ownership to the server, so that when it is picked up by someone else, it won’t have conflicting network ownership?
On another note, I think that a weld links the characters together. Is there any way to keep two parts attached with similar properties to a weld (not motor6D, since it clearly links the parts together)?
What do you think about it? @bt5191