How can i keep the model behind the player?

I’m trying to make a model that follows the player from behind and cannot go in front of the player.

	local angle = Character.Head.Orientation

	model:SetPrimaryPartCFrame( -,-1,-2)) *CFrame.Angles(0, math.rad(angle.Y), 0))
1 Like

This is where CFrame:ToWorldSpace() comes to play. If you haven’t heard about WorldSpace and ObjectSpace before, I recommend reading up about it on the wiki’s CFrame section.

Basically, what this does is returns a CFrame value from the given CFrame parameter in WorldSpace.

So, we can use this to achieve your request:
(Make sure your Model has a primary part set to it)

local Model = workspace.Model --Set this to the model you want ofc
local Part = game.Players.LocalPlayer.Character.Head --This is the part to go behind. Will be using the player's hide like you did.

local Offset =,0,5) --This will be the offset of the position from the Head to the model

   local NewModelCFrame = Part.CFrame:ToWorldSpace(Offset) --This will get the CFrame of the position behind the head with the offset we gave it.
   Model:SetPrimaryPartCFrame(NewModelCFrame) --This will put the Model behind the head, 5 studs away.

The above script will also make the model have the same orientation of the head. If you dont want this, just use :PointToWorldSpace() instead of :ToWorldSpace() which returns a Vector3 value instead of a CFrame value.

Hope this helps! :slight_smile:


Thanks a lot, i appreciate it.

1 Like