#Trying to tween eyes closed + Track the player.

1 messages · Page 1 of 1 (latest)

oblique pollen
#

So the cupcake in the video is supposed to have its eyes closed while the local player is outside the room, but once they walk in, the eyes are supposed to open, then follow the player. Once they leave the room, the eyes should close. The player tracking looks bugged in the video, but when I remove the tweens from the script, the tracking works fine.

#
-- GIANT CUPCAKE --

local cupcake = workspace.Map.Map:WaitForChild("giantCupcake")    
local gCHeadData = cupcake:WaitForChild("Head")

local gCcontainer = cupcake:WaitForChild("cupcakeZone")
local gCZone = zonesPlus.new(gCcontainer)

local lerpAlpha = 0.05

gCZone.localPlayerEntered:Connect(function()
    local gCLoop
    gCLoop = runService.RenderStepped:Connect(function()
        local targetPos = pHead.Position
        
        tweenServ:Create(gCHeadData.RightUpperEyelid, TweenInfo.new(2), {Position = Vector3.new(45.227, 6.576, 353.288), Orientation = Vector3.new(-0, 100, -180)}):Play()
        tweenServ:Create(gCHeadData.RightLowerEyelid, TweenInfo.new(2), {Position = Vector3.new(45.225, 6.159, 353.276), Orientation = Vector3.new(-0, 100, -180)}):Play()
        tweenServ:Create(gCHeadData.LeftUpperEyelid, TweenInfo.new(2), {Position = Vector3.new(42.265, 6.576, 353.818), Orientation = Vector3.new(-0, 100, -180)}):Play()
        tweenServ:Create(gCHeadData.LeftLowerEyelid, TweenInfo.new(2), {Position = Vector3.new(42.263, 6.159, 353.805), Orientation = Vector3.new(-0, 100, -180)}):Play()
        
        task.wait(2.5)
        
        --Head--
        
        local gCHead = cupcake.Head
        local gCHeadPivot = gCHead:GetPivot()
        local gCHeadPos = gCHeadPivot.Position
        local gCLookAt = Vector3.new(targetPos.X, gCHeadPos.Y, targetPos.Z)
        local targetY = CFrame.lookAt(gCHeadPos, gCLookAt, Vector3.new(0,1,0))
        local gCLerp = gCHeadPivot:Lerp(targetY, lerpAlpha)
        gCHead:PivotTo(gCLerp)

        --Eyes--

        local gCEyes = cupcake.Head:WaitForChild("Eyes")
        for _, eye in ipairs(gCEyes:GetChildren()) do
            if eye.Name ~= "PrimaryEyes" then
                local eyePos = eye.Position
                eye.CFrame = CFrame.new(eyePos, targetPos)
            end
        end
        
        gCZone.localPlayerExited:Connect(function()
            gCLoop:Disconnect()
            
            tweenServ:Create(gCHeadData.RightUpperEyelid, TweenInfo.new(2), {Position = Vector3.new(45.244, 6.549, 353.387), Orientation = Vector3.new(0, 100, -150)}):Play()
            tweenServ:Create(gCHeadData.RightLowerEyelid, TweenInfo.new(2), {Position = Vector3.new(45.249, 6.218, 353.416), Orientation = Vector3.new(0, 100, 135)}):Play()
            tweenServ:Create(gCHeadData.LeftUpperEyelid, TweenInfo.new(2), {Position = Vector3.new(42.283, 6.549, 353.917), Orientation = Vector3.new(0, 100, -150)}):Play()
            tweenServ:Create(gCHeadData.LeftLowerEyelid, TweenInfo.new(2), {Position = Vector3.new(42.288, 6.218, 353.945), Orientation = Vector3.new(0, 100, 135)}):Play()
        end)
    end)
end)
loud bobcat
#

just animate it 🥀

wooden field
#

maybe move the tweens outside the loop?

worthy stagBOT
#

studio** You are now Level 1! **studio

oblique pollen
loud bobcat
#

rigging stuff is easy

#

make sure its in model

oblique pollen
#

its just a cupcake doe

worthy stagBOT
#

studio** You are now Level 8! **studio

loud bobcat
#

use motor6d's and welds to rig everything

#

and yeah

oblique pollen
loud bobcat
#

no

#

probably will mess up the script but idk

oblique pollen
#

yeahhh thats why i was doing tweening

oblique pollen
loud bobcat
#

run it seperately

worthy stagBOT
#

studio** You are now Level 7! **studio

loud bobcat
#

too lazy to think of solution so just put in seperate script

#

1 for eye blink