Basically, I have a part (it’s a duck) which contains the BodyPosition and BodyGyro, which are so the duck follows the player. This works fine. Until I try adding other parts to the duck (a hat for example)
I simply add the extra part, weld it to the duck, and by my logic, it should connect the hat to the duck, and go wherever the duck goes. However, the duck now spazzes out
Showing, 1 - Common (which has no hats, just the simple duck) is perfectly right next to my character, meanwhile, 3 - Common (which has the Handle attached to it) goes nuts around the screen (you can kinda see the blue box outline, but it’s moving so fast around the screen it’s hard to see)
How are you welding the hat? If you just set the Part0 and Part1 of the weld, it will obviously go riot since the 2 objects are stuck in each other. You need to specify the C0 and C1 before applying the weld to both parts (since applying to one won’t affect anything).
I was just using a plugin. I selected the 2 parts, clicked weld, and it weld them. I’ve this plugin before for welding together other models, and it’s worked great
function CreateDuck.OnServerInvoke(Player, Tier, Rarity)
local PlayersDuck = Ducks['Tier ' .. Tier][Rarity]:Clone()
PlayersDuck.Name = Tier .. ' - ' .. Rarity
PlayersDuck.Parent = Player.Character
for i, v in pairs(PlayersDuck:GetDescendants()) do
if v.Name == 'Handle' then
local Weld = Instance.new('Weld')
Weld.Name = 'Weld'
Weld.Part0 = PlayersDuck.Duck
Weld.Part1 = v
Weld.C0 = CFrame.new()
Weld.Parent = v
end
end
for i, v in pairs(PlayersDuck:GetDescendants()) do
if v:IsA('Part') or v:IsA('MeshPart') then
v:SetNetworkOwner(Player)
end
end
return PlayersDuck
end
This is what I got, duck still goes flying around the screen
Unless the Handle is already welded to another part with an offset, the code block that welds the parts basically does nothing since CFrame.new() returns an identity CFrame (0 offset and 0 rotation) and the Weld’s default C0 and C1 values are identity CFrames. Set the CFrame to the wanted distance offset (CFrame.new(0,1,0) or such). Or you could just disable collisions for the hat.
Collisions for both Duck and Handle are already set to false, and they arent anchored either.
Not entirely sure what you meant from your answer, slightly confused. Do you want me to just get rid of the C0?? It seems kinda useless to have, but if I did, I’d be right back where I started
Thinking about it right now, you could try making the accessory Massless? That should fix the issue, considering that body positions usually spaz out if the object tries to reach the target with too much force.
As for the C0, I was just saying that the entire block of code is weird considering it searches for a part with an already defined name and could be shortened using only :FindFirstChild(). The C0 is also useless since you are changing the property to a value that’s the same, but still requires Roblox to create a new userdata.
You tried setting the accessory’s Massless to true, right? That will stop it from affecting the structure’s mass if there is another part that has mass.