aviel101
(Time)
1
i’m trying to move 1 object towards other, and don’t stop on the other object but keep moving in same direction, i tried this
local Targ = FindNearestPlayer(script.Parent.Position)
local Attack = script.Parent
local Tween = TweenService:Create(Attack, TweenInfo.new(
1,
Enum.EasingStyle.Back,
Enum.EasingDirection.In
),
{Position = Targ.Position}
)
Tween:Play()
but it stops on Target position, so how can i make it keep moving forward forever, or until specific distance
Google the keywords Unit vectors
and Normalized vectors
aviel101
(Time)
3
finally found a way to solve it, here’s what i did
local Targ = FindNearestTorso(script.Parent.Position).Position
local Attack = script.Parent
local tween = TweenService:Create(Attack,
TweenInfo.new(
script.Parent.TTL.Value + 1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In
),
{Position = Attack.Position + (Targ - Attack.Position).unit * 100 * script.Parent.TTL.Value}
)
tween:Play()