Part following player

So, I was testing some things on a baseplate and I thought of a part following the player. Well I tried to do that but it only followed one place. Here is what I am referencing.

timeline 2:20
(Credits to DoorBreaker not my video)
also the script

local TweenService = game:GetService("TweenService")
local player = game.Players.LocalPlayer.Character
local model = workspace.Mustard:WaitForChild("Hitbox")

local missle = TweenService:Create(
	model,
	TweenInfo.new(10, Enum.EasingStyle.Linear, Enum.EasingDirection.In),
	{Position = player.HumanoidRootPart.Position}
)

while wait() do
	missle:Play()
end

The tween info currently only gets the humanoid root part’s position once in your script which means when the player moves it will not update. You can insert the tween info in the loop or create a function that plays the tween with the updated position.

1 Like

Well, I tried it but it slows down when it’s closer.

Because your tween time is set to 10. Decrease it depending on the difference between the part and RootParts position.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.