I have 2 parts, one follows the mouse, and another follows the part that follows the mouse:
I will call the blue part “BluePart” and the green part “GreenPart”.
What’s happening is that when BluePart gets close to GreenPart, it gets slow, and when it moves away, it gets fast:
Here is the code:
-->> Modules <<--
local _S = require(workspace.Services)
-->> Variables <<--
local sp = script.Parent
local target = workspace['TargetPart_SacerRaym_BR']
local tweenInfo = TweenInfo.new(
2,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In,
0,
false,
0
)
-->> Functions <<--
_S.RunService.Heartbeat:Connect(function()
local tween = _S.TweenService:Create(sp, tweenInfo, {Position = target.Position})
tween:Play()
end)