How can I move a part towards the player

I want to make a part move towards and look at the player. Ive got everything except the movement and looking at the player.

Ive tried using CFrame.LookAt and just moving the part forward but that’s inefficient and buggy. Any help is appreciated

1 Like

Mind explaining a few things for me?

do you want the part to rotate to look at the player then gradually move towards the player?
or do you want it to kind of just instantly look at the player and appear in front?

Also if this for some type of NPC thing?

basically im trying to make scp 173 all I need it to do is look at the player and move to the player a bit

This textbox below will rotate a model to look at you

local TweenService = game:GetService("TweenService")
local player = game.Players.LocalPlayer.Character -- change this with the player you want
local scp = workspace.Scp173 -- change this to where it's located in the explorer

-- This gets the CFrame values of the part and player to rotate the part properly
local final = CFrame.new(player.HumanoidRootPart.Position, scp.PrimaryPart.Position)

local partLookAtPlayer = TweenService:Create(
	player.HumanoidRootPart, -- gets the player root part
	TweenInfo.new(0.5), -- Takes 0.5 seconds to look at the player
	{CFrame = final} -- Rotates the model
)

partLookAtPlayer:Play() -- starts the tween/animation of the model turning tot he player

Since it’s a model, you can use :MoveTo
We already defined the player and scp above but i’ll write it one more time below.

local player = game.Players.LocalPlayer.Character -- change this with the player you want
local scp = workspace.Scp173 -- change this to where it's located in the explorer

-- Moves the model to the players location. Make sure the scp model has a humanoid instance in it
scp.Humanoid:MoveTo(player.Character.HumanoidRootPart.Position)
3 Likes

Looks like it would work but for some reason it bugs the player in the ground image

This is the scps setup am I doing something wrong

Ive realized that its a problem with the Look at script

Did you set SomePart as the PrimaryPart of the Scp173 model?