Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Unable to cast Dictionary to TweenInfo?

Asked by
CedCed6 32
2 years ago

I was trying to make a repeating and tweening camera using while true do and tweeninfo. The current camera CFrame starts on the first camera and would switch into the second camera every 7 seconds with a tween and also on repeat.


local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable local tweenService = game:GetService("TweenService") function tween(part1, part2) local tweenInfo = TweenInfo.new(5,Enum.EasingStyle.Quad,Enum.EasingDirection.Out) local tween1 = tweenService:Create(camera, TweenInfo, {CFrame = part2.CFrame}) local tween2 = tweenService:Create(camera, TweenInfo, {CFrame = part1.CFrame}) while true do camera.CFrame = part1.CFrame tween1:Play() wait(7) tween2:Play() wait(7) end end tween(game.Workspace.Cam1, game.Workspace.Cam2)
0
oh wait i realized, you made a typo in line 8 and line 9 NGC4637 602 — 2y

1 answer

Log in to vote
1
Answered by
Rare_tendo 3000 Moderation Voter Community Moderator
2 years ago

In the Create functions, you meant to type tweenInfo instead of TweenInfo for the 2nd argument. It references the TweenInfo dictionary instead of your TweenInfo instance

Ad

Answer this question