Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Tweening a player's head?

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)

1 answer

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)})

This discussion is preserved as it was. New answers, comments, and votes are closed.