TweenService Unable to cast to Dictionary error

I’m unsure how to fix the “Unable to cast to Dictionary” error. Is there something wrong with my Tween?

local hrp = ally.Manifestation.PrimaryPart
local ehrp = enemy.Manifestation.PrimaryPart

v Problem v

			local orig=hrp.CFrame
			local tweenService = game:GetService("TweenService")
			local tweeninfo =TweenInfo.new(
				2.5,
				Enum.EasingStyle.Sine,
				Enum.EasingDirection.Out,
				0,
				false,
				0)
			local tween = tweenService:Create(hrp, tweeninfo, ehrp) 
			local tween2 = tweenService:Create(hrp, tweeninfo, orig) 
			tween:Play()
			tween.Completed:Wait()
			tween2:Play()
			tween2.Completed:Wait()

You need to put an dictionary table for the 3rd input in tweenService:Create()

local ehrp = {CFrame = enemy.Manifestation.PrimaryPart.CFrame}
local orig= {CFrame = hrp.CFrame}

local tween = tweenService:Create(hrp, tweeninfo, ehrp) 
local tween2 = tweenService:Create(hrp, tweeninfo, orig) 

Thank you, the code wasn’t working at first but with a slight change. It’s all good now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.