so im trying to tween the camera towards another part when you click a gui but it isnt working i think the problem is with the tween creation
my script:
local TweenService = game:GetService("TweenService")
local object = script.Parent
object.AnchorPoint = Vector2.new(0.5, 0.5)
object.Position = UDim2.new(-3, 0, 0.5, 0)
local cam = game.Workspace.CurrentCamera
local FocusPart = game.Workspace.CamPart2
TweenInfo.new (3.0,Enum.EasingStyle.Quad,Enum.EasingDirection.Out, 0,false, 0 )
wait(7)
object:TweenPosition(UDim2.new(0.5, 0,
0.5,0),Enum.EasingDirection.Out,Enum.EasingStyle.Back)
local function onActivated() --part that isn't working
cam.CameraSubject = FocusPart
cam.CameraType = Enum.CameraType.Scriptable
local tween = TweenService:Create(cam,TweenInfo,{CFrame = FocusPart.CFrame} )
tween:Play()
end
object.Activated:Connect(onActivated)

1 comment
thx took a while to accept it as a answer because roblox was down and stuff