You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to make the part that is welded to body rotate with it like single model
- What is the issue? Include screenshots / videos if possible!
When im turning around, the part is hitting in the x (or z) axis
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to make childadded event handler, but nothing changed
Here’s the code:
game.Players.PlayerAdded:Connect(function(player)
if player:IsDescendantOf(game.Players) then
local char = player.Character or player.CharacterAdded:Wait()
local head = char:WaitForChild("Head")
local facepart = char:WaitForChild("FacePart")
facepart.Anchored = false
local newCFrame = head.CFrame * CFrame.new(0, 3, -3) * CFrame.Angles(math.rad(45),0,0)
facepart.CFrame = newCFrame
local localPosition = facepart.CFrame:PointToObjectSpace(newCFrame.Position)
local weld = Instance.new("Weld")
weld.Parent = facepart
weld.Part0 = head
weld.Part1 = facepart
weld.C1 = CFrame.new(localPosition) * CFrame.Angles(math.rad(-45),0,0)
end
end)
Thanks.