Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why will my camera not tween?

Asked by 3 years ago

Hello,

I'm making a shop in my game and I would like to tween the camera to a different location when a button is clicked. Here is my script:

local button = script.Parent
local camera = workspace.CurrentCamera

local TweenService = game:GetService("TweenService")

camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = workspace.Warehouse.LobbyCamera
camera.CFrame = workspace.Warehouse.LobbyCamera.CFrame

local Info = TweenInfo.new(
    3,
    Enum.EasingStyle.Sine,
    Enum.EasingDirection.In,
    0,
    false,
    0.5
)

local camTween = TweenService:Create(camera, Info, {CFrame = workspace.ShopCamera.CFrame})

button.MouseButton1Click:Connect(function()
    button.Parent.Visible = false
    camTween:Play()
end)

For some reason it was working before but when I came back and tried it it stopped working. There is no error in the output so I'm not sure what I should do.

If anyone could help I would be very appreciative. Thank you!

0
Try printing Soban06 410 — 3y
0
I've tried and it prints but doesn't tween. TRJ1411 0 — 3y

Answer this question