Hi, I was just wondering how I would be able to create a script to zoom into a surface GUI smoothly (Just like the SCR Concourse Information Boards)
camera manipulation.
rough script idea
-- local script in where ever you want
local part = -- path to part
local clickdector = part.CD
local gui = part.UI
local cam = workspace.CurrentCamera
local function tween(o,d,g)
game:GetService("TweenService"):Create(o,tweeninfo.new(d),g):Play()
end
clickdector.MouseClick:Connect(function()
local origin = (part.CFrame * CFrame.new(0,0,-5 --[[distance]])).Position
local cf = CFrame.new(origin,part.Position)
cam.CameraType = Enum.CameraType.Scriptable
tween(cam,1--[[interpolation duration]],{CFrame = cf})
end)
Thanks for that! Just wondering, would you know how to zoom back out?
just set cameratype to default aka fixed
Also for my use case, the surface gui would be moving, is there any way to adapt it to allow it to move with the surface gui?
if the part is moving with the gui then yea just slap it in a runservice loop if the gui is moving then you gotta use maths.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.