So, whenever I run the tweening script, I receive this error: Workspace.Model.Script:9: attempt to index nil with ‘Position’
Here’s the script I used:
local TS = game:GetService("TweenService")
local Model = script.Parent
local TI = TweenInfo.new(5, Enum.EasingStyle.Linear )
local Goal = {}
Goal.WorldPivot.Position = (1,0.5,10)
local Tween = TS:Create( Model, TI, Goal )
Tween:Play()
You’re trying to get the WorldPivot of goal (the table), but you haven’t added that to the table, I’m assuming you meant to set goal to something else?
No, I want to goal the position of the Model. I used " Goal.Position " but there were no property called “Position”, so I used " Goal.WorldPivot.Position "
local TS = game:GetService("TweenService")
local Model = script.Parent
local TI = TweenInfo.new(5, Enum.EasingStyle.Linear )
local Goal = {WorldPivot = CFrame.new(Vector3.new(1, .5, 10))}
local Tween = TS:Create( Model, TI, Goal)
Tween:Play()
I mean all it does is change the worldpivot, if you want to change the position the best way to do it is to assign it a primarypart, then tween that. (make sure everything is connected to the primarypart with a weldconstraint and it’s not anchored)