I am currently trying to tween a bullet to move to the enemy’s primary part position. I keep on getting Unable to cast to Dictionary.
local module = {}
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
1, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.InOut, -- EasingDirection
-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
function module.Attack(Unit, Target)
local Folder = script.Parent.Parent
local Bullet = Folder.Bullet:Clone()
Bullet.Parent = workspace
Bullet.Position = Unit.Gun.Position
local Tween = TweenService:Create(Bullet, tweenInfo, Target.PrimaryPart.Position)
Tween:Play()
Tween.Completed:Connect(function()
Bullet:Destroy()
end)
end
return module