I’m currently trying to write a script that makes a model point towards a player at all times
this is the script I’m using:
local function FollowPlayer()
if selectedPlayer then
local player = selectedPlayer
local character = player.Character
if character then
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
local direction = (humanoidRootPart.Position - spotlight.PrimaryPart.Position).Unit
spotlight.PrimaryPart.CFrame = CFrame.lookAt(spotlight.PrimaryPart.Position, humanoidRootPart.Position, humanoidRootPart.Position)
end
end
end
end
local RunService = game:GetService("RunService")
RunService.Heartbeat:Connect(FollowPlayer)
(SelectedPlayer is already defined in a separate part of the script, no need to worry about that)
This is what the model looks like, if any extra information is needed let me know
Thanks in advance!