Hi guys, I'm having trouble. My bunny mesh keeps facing the wrong way when I make it sit on my shoulder. Here's the script.
function createWeld(p1, p2, model, cframe)
local weld=Instance.new("ManualWeld", model)
weld.Part0=p1
weld.Part1=p2
weld.C0=(p2.CFrame*cframe):inverse()*p1.CFrame //HELP
weld.C1=(p1.CFrame*cframe):inverse()*p2.CFrame //Idk much about this
end
game.Players.PlayerAdded:connect(function(ply)
ply.CharacterAppearanceLoaded:connect(function(char)
local group=Instance.new("Model",char)
group.Name="Bunny"
local body=game.Workspace["Light Bunny"].Body:Clone()
body.Parent=group
body.Anchored=false
local eye=game.Workspace["Light Bunny"].Eye:Clone()
eye.Parent=group
eye.Anchored=false
createWeld(body,char:findFirstChild("Torso"),group,CFrame.new(1,-1.55,0)*CFrame.Angles(math.pi,-math.pi,math.pi)) //Important call to the function
createWeld(eye,body,group,CFrame.new(0,-1,0))
end)
end) |