how do I tween Vector3 Values, I am setting the goal Position of an Align Position Constraint, and instead of instantly setting the new goal each time it changes (I’m making a vehicle), how do I get it to smoothly transition. This is my code:
local function tweenDirection(goalVector)
print(goalVector)
local VectorValue = Instance.new("Vector3Value")
VectorValue.Value = UFO.AlignPosition.Position
local info = TweenInfo.new(0.5, Enum.EasingStyle.Circular)
local tween = TweenService:Create(VectorValue, info, {goalVector})
VectorValue.Changed:Connect(function()
UFO.AlignPosition.Position = VectorValue.Value
end)
tween:Play()
tween.Completed:Connect(function()
VectorValue:Destroy()
end)
end
local function tweenDirection(goalVector)
print(goalVector)
local VectorValue = Instance.new("Vector3Value")
VectorValue.Value = UFO.AlignPosition.Position
local info = TweenInfo.new(0.5, Enum.EasingStyle.Circular)
local tween = TweenService:Create(VectorValue, info, {Value = goalVector})
VectorValue.Changed:Connect(function()
UFO.AlignPosition.Position = VectorValue.Value
end)
tween:Play()
tween.Completed:Connect(function()
VectorValue:Destroy()
end)
end