How to make a Model follow the player?

Hey all, first time posting here.

Lately I have been developing a 1 player game, but I am still an amateur to scripting so I have an issue.

The title explains it, I don’t know how to make a model follow the player. This is the model in question.

I have tried looking it up, but most of the solutions to this problem seems either outdated or unexplained.

No need for animations btw, I just need the model to follow the player on the ground, in a normal way

Can someone help me or link me to a post that helps with it?

Any help appreciated btw!

1 Like

You can use TweenService and tween a CFrameValue, then set the model’s position to it. Here’s a simple example with a LocalScript, since the game is one player only there shouldn’t be any problems.

local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")

local Character = script.Parent
local Model = workspace.Model
local CFrameValue = Model.CFrameValue

local Info = TweenInfo.new(.5)

CFrameValue.Changed:Connect(function()
	Model:PivotTo(CFrameValue.Value*CFrame.fromEulerAnglesXYZ(Character:GetPivot():ToEulerAnglesXYZ()))
end)

while true do
	local Tween = TweenService:Create(
		CFrameValue,
		Info,
		{Value = CFrame.new(Character:GetPivot().p.X-5, 0, Character:GetPivot().p.Z)}
	)
	
	Tween:Play()
	Tween:Destroy()
	RunService.RenderStepped:Wait()
end

image

image

9 Likes