could you animate a part and copy the parts cframe to the camera?
is this a good method and if so how could you do this
could you animate a part and copy the parts cframe to the camera?
is this a good method and if so how could you do this
It is possible to put the Camera’s CFrame onto the part. First you need to make the camera Scriptable so that the player can’t edit it.
camera.CameraType = Enum.CameraType.Scriptable
And the main code you need is:
camera.CFrame = part.CFrame
Since the part would be animated, that line of code has to execute per rendering pass. And a variable can be added if you want to enable or disable the CFrame modification.
local runService = game:GetService("RunService")
local cameraIsFollowingPart = true
runService.PreRender:Connect(function() -- Happens prior to rendering.
camera.CameraType = Enum.CameraType[cameraIsFollowingPart and "Scriptable" or "Custom"]
if not cameraIsFollowingPart then return end
camera.CFrame = part.CFrame
end)
You can use TweenService to animate the part.