So I've been trying to tween a player's head, but I can't seem to get it working. It grabs the player's head correctly, it's just the tween that won't work. It's supposed to rotate the player's head 90 degrees when the part is touched.
If someone could give me an answer for why this isn't working I'd be very grateful!
local TweenService = game:GetService("TweenService") local spininfo = TweenInfo.new(1,Enum.EasingStyle.Back) local part = script.Parent SpinVar = false function OnTouched(PlayerPart) local IsPlayer = PlayerPart.Parent:FindFirstChild("Humanoid") if IsPlayer and SpinVar == false then local Character = PlayerPart.Parent.Head local Spin1 = TweenService:Create(Character,spininfo,{CFrame = Character.CFrame * CFrame.Angles(0,math.rad(90),0)}) Spin1:Play() wait(1) SpinVar = true end end part.Touched:Connect(OnTouched)
Figured it out! Putting it here for future reference.
Neck = Character.Neck local Spin1 = TweenService:Create(Neck,spininfo,{C0 = Neck.C0 * CFrame.Angles(0,math.rad(90),0)})