You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I would like to be able to have a tween animation where the camera moves from a position to another.
What is the issue? Include screenshots / videos if possible!
This error comes out: Unable to cast to Dictionary
local FatherWinterModule = {}
function FatherWinterModule.FirstCamera(player)
--Camera
local currentcamera = workspace.CurrentCamera
local pc = workspace.Winter.WinterCam
local FinalPosition = workspace.Winter.FinalWinterCam
currentcamera.CameraType = Enum.CameraType.Scriptable
currentcamera.CFrame = pc.CFrame
--Variables
local TweenService = game:GetService("TweenService")
local Father = workspace.Winter.FatherWinter
local CameraMove = TweenService:Create(currentcamera.CFrame, TweenInfo.new(1), FinalPosition.CFrame)
CameraMove:Play()
end
return FatherWinterModule
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Tried looking around, found nothing
The argument where you put the CFrame actually needs to be a dictionary. Each key inside the dictionary is the property you want to change (written exactly as is in the properties tab) and the value is the value you want it to change to
In your first argument you specify currentCamera.CFrame, giving the function the cameras CFrame. But this function expects an object as the first argument, so it tries to convert it to an object (which is not possible). Remove the .CFrame