I am currently making VFX, and while trying to tween a Rock to a position/cframe, the Rock becomes very glitchy. Below is the code that tween the rocks.
local RocksVFX = game.ReplicatedStorage.VFX.TaktRock:Clone()
RocksVFX.Parent = workspace
RocksVFX.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(Vector3.new(0, -20, 0))
local tween = TweenService:Create(
RocksVFX,
TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1, false, 0),
{CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(Vector3.new(0, 13, 0)) }
)
tween:Play()
task.wait(1)
tween:Cancel()
RocksVFX.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(Vector3.new(0, 13, 0))
local tween1 = TweenService:Create(
RocksVFX,
TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1, false, 0),
{CFrame = MouseLocationCFrame * CFrame.new(Vector3.new(0, -2, 0)) }
)
tween1:Play()
task.wait(0.3)
tween1:Cancel()
RocksVFX.CFrame = MouseLocationCFrame * CFrame.new(Vector3.new(0, -2, 0))
Here is the video of what I am talking about.
https://i.gyazo.com/7767f09b4e56a98a3412b738693e169c.mp4