Hello!
So basically in my fnaf fangame, I have a light mechanic. Basically at one moment, a character will slowly go in front of the office and go to a vent.
Now there’s a mechanic of a light, if we flashed it, the character stops.
And basically I got things correctly, but as the title says, I want to know how to make the npc look at something.
I thought of maybe turning the HumanoidRootPart to a rotation but I am pretty sure there’s another way.
So here’s my script
local sun = script.Parent
local humanoid = sun.Humanoid
local Humpart = script.Parent.HumanoidRootPart
humanoid:MoveTo(workspace.FrontOfOffice.Position)
humanoid.MoveToFinished:Wait()
humanoid:MoveTo(workspace.FrontOfOffice2.Position)
humanoid.MoveToFinished:Wait()
humanoid.WalkSpeed = 1
local WalkAnim = script.Parent.Animate.walk.WalkAnim
humanoid:MoveTo(workspace.TOGLASS.Position)
local LC = game.Workspace.LightConditions
LC.Flashing:GetPropertyChangedSignal("Value"):Connect(function()
humanoid:MoveTo(Humpart.Position)
print("OH NO I HAVE BEEN FLASHED!")
--Now we turn to something
wait(5)
humanoid:MoveTo(workspace.TOGLASS.Position)
end)
humanoid.MoveToFinished:Wait()