Whenever the character moves the object stays floating in the position. Is it because I’ve welded it to the HumanoidRootPart that why its not moving? The object just doesn’t move with the character
I have added a script in ServerScriptService which attaches the object to the HumanoidRootPart:
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local PanCase = script.PanCase:Clone()
PanCase:SetPrimaryPartCFrame(Character.HumanoidRootPart.CFrame)
PanCase.Parent = Character
local PanCaseWeldConstraint = Instance.new("WeldConstraint")
PanCaseWeldConstraint.Part0 = PanCase.PrimaryPart
PanCaseWeldConstraint.Part1 = Character.PrimaryPart
PanCaseWeldConstraint.Parent = PanCaseWeldConstraint.Part0
end)
end)
Your character probably doesn’t have a PrimaryPart when you’re calling this. Try doing weldConstraint.Part1 = character:WaitForChild('HumanoidRootPart') instead.
I tried doing your method however, it didn’t seem to work. I probably should’ve mentioned this but the PanCase is stored inside the script and has a PrimaryPart called Main.
Try setting the parent of the PanCaseWeldConstraint before setting its part0 and part1 properties. If still no luck, are there any output errors? If not, check in the properties window and see if the weld’s Part0 and Part1 properties aren’t blank. Also, is the weld’s Active property true?
Don’t use WeldConstraints instead, use Welds and set the C0 to the HRP
if you use WeldConstraints it will only move the position one time, instead if you use normal welds and set the C0, it will move all the time along with the player
i worked with welds already and i had this problem too
Interesting, the active property of the weld constraint in the first screenshot isn’t active. Is the entire assembly unanchored? If not, try doing that. Also, I suggest switching to :PivotTo instead of using :SetPrimaryPartCFrame.
ok what you can do is make a block and adjust the size of it to be like the pan, change the transparency to 1, weld it with a WeldConstraint to the pan mesh in the explorer, and use that as the pan
and also make sure that the primarypart of the model is that part