Probably a frequently asked and used question but here it is. I've welded a Part (duck) above the Character's head upon joining. But I'm unaware of how to make it spin? What I've got so far just makes it do something.... weird*?
--PlayerAdded script (ServerScriptService)
function makeDuck(plr)
local duck = script["Blue Duck"]:clone()
duck.Parent = plr.Character
duck.Position = plr.Character.Head.Position + Vector3.new(0, 4, 0)
duck.Rotation = plr.Character.Head.Rotation
local weldTo = plr.Character.Head
local weldToCf = weldTo.CFrame:inverse()
local weld = Instance.new("Weld")
weld.Name = "DuckWelding(warning, high temperatures)"
weld.Part0 = weldTo
weld.Part1 = duck
weld.C0 = weldToCf
weld.C1 = duck.CFrame:inverse()
weld.Parent = weldTo
duck.Anchored = false
duck.CanCollide = false
end
And then after this:
--Script inside duck
local duck = script.Parent
function rotateSomeDuckyThatIUsedToKnow()
local weldForDuck = duck.Parent:FindFirstChild("Head")["DuckWelding(warning, high temperatures)"]
while wait() do
weldForDuck.C0 = duck.CFrame:inverse()*CFrame.fromEulerAnglesXYZ(0, math.pi/180, 0)
end --This is basically the only line that doesn't do what I want it to
end
duck.AncestryChanged:connect(function(child, parent)
print("someDuckyThatIUsedToKnow got TRIGGERED!!!!!") wait(5)
if parent:IsA("Model") then
rotateSomeDuckyThatIUsedToKnow()
end
end)
The line inside the while loop in rotateSomeDuckyThatIUsedToKnow() is basically the only part I'm ignorant of what I'm supposed to be doing. Can someone explain what's happening here? According to what I read from the wiki, it should rotate the duck.
*As I wrote this I found one thing I was doing wrong; so weird now means it is kinda moderating its position above the head as if it's some futuristic hoverboard.

3 comments
Spinning as in rotating on axis maintaining position above head.
If u want it to spin, why weld the duck to the head? doesn't that stop it from spinning?
So would you suggest I create my own weld concept? Maybe a loop that updates the CFrame, maintaining position above head? To then use CFrame Angles to create the spin?