Rienknr1
(Jarvo)
July 19, 2024, 3:38pm
1
Hey there!
I’m having a little issue here.
Somehow the logs say: Unable to cast to dictionary
I can’t find what is going wrong here. Maybe some of you do.
I appreciate any help.
The issue occurs at the bottom line of the below code (The tween itself).
local Cam = workspace.CurrentCamera
Cam.CameraType = "Scriptable"
Cam.Focus = CFrame.new(469, 126, 29)
Cam.CoordinateFrame = CFrame.new(418, 137, 107)
local tweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, 0, false, 0)
local tween = game:GetService("TweenService"):Create(Cam, tweenInfo, {CFrame = CFrame.new(418, 137, 107),CFrame.new(469, 126, 106),25})
4 Likes
Jarvo:
local tween = game:GetService("TweenService"):Create(Cam, tweenInfo, {CFrame = CFrame.new(418, 137, 107),CFrame.new(469, 126, 106),25})
Remove two last values in table CFrame.new(469, 126, 106) and 25
1 Like
Rienknr1
(Jarvo)
July 19, 2024, 3:40pm
3
Alright. I will try this. Hold up.
2 Likes
Rienknr1
(Jarvo)
July 19, 2024, 3:48pm
4
Have to try the other cframe. But probably it works. Can’t say yet.
1 Like
Rienknr1
(Jarvo)
July 19, 2024, 3:54pm
5
Okay, that didn’t worked. It just instantly goes back to my player ( tween.Completed:Connect() )
1 Like
But did it fixed the “Unable to cast to dictionary” error?
1 Like
Rienknr1
(Jarvo)
July 19, 2024, 3:58pm
7
Yes it did fixed the error (It’s not there)
But didn’t fixed what the camera actually should do.
The old script is:
local Cam = Workspace.CurrentCamera
Cam.CameraType = "Scriptable"
Cam.Focus = CFrame.new(469, 126, 29)
Cam.CoordinateFrame = CFrame.new(418, 137, 107)
Cam:Interpolate(CFrame.new(418, 137, 107),CFrame.new(469, 126, 106),25)
And that one worked… But I saw Interpolate is deprecated and just wanted to recode it.
2 Likes
happya_x
(Happya)
July 19, 2024, 4:11pm
8
i think the first and second argument to interpolate are start and end points
to convert to a tween you should set it to the initial position and then tween to the end position
local Cam = Workspace.CurrentCamera
Cam.CameraType = "Scriptable"
Cam.Focus = CFrame.new(469, 126, 29)
Cam.CoordinateFrame = CFrame.new(418, 137, 107)
Cam.CFrame = CFrame.new(418, 137, 107)
local tweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, 0, false, 0)
game:GetService("TweenService"):Create(Cam, tweenInfo, {CFrame = CFrame.new(469, 126, 106)}):Play()
1 Like
Rienknr1
(Jarvo)
July 19, 2024, 4:22pm
9
local Cam = Workspace.CurrentCamera
Cam.CameraType = "Scriptable"
Cam.Focus = CFrame.new(469, 126, 29)
Cam.CoordinateFrame = CFrame.new(418, 137, 107)
Cam.CFrame = CFrame.new(418, 137, 107)
local tweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, 0, false, 0)
game:GetService("TweenService"):Create(Cam, tweenInfo, {CFrame = CFrame.new(469, 126, 106)}):Play()
Oh. Alright. I will see if this works
Rienknr1
(Jarvo)
July 19, 2024, 4:28pm
10
Still not what I was looking for. But I just recently fixed it myself using the old camera method.
system
(system)
Closed
August 2, 2024, 4:29pm
11
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.