Within the script, I have an Ai that whenever they see the player, the player will look at them in the face. So I looked at CFrame.lookat() for help, but only issue is that it feels to snappy.
I saw other posts of lerping CFrame.Lookat, but when I try it, it doesn’t work.
It doesn’t print errors, and I also checked if the code was running with prints. I have no idea what to do anymore.
local Camera = workspace.CurrentCamera
AiSeesPlayerEvent.OnClientEvent:Connect(function(NPCHead)
local TargetCFrame = CFrame.lookAt(Camera.CFrame.Position, NPCHead.Position)
for i = 1, 90 do
task.wait()
print("Should be working fine")
Camera.CFrame:Lerp(TargetCFrame, i)
end
task.wait(1)
end)
Also sorry for any small mistakes, I’m still a beginner right now
I’ve also looked into Tweenservice for this as well, but when it tweens, the camera isnt on the players head. In my game, the player is constantly moving, so having a Tween that starts where the player previously was wouldn’t be possible.
Is there a way I can have an effect like this?
(An example is when you look at The rake in “The Rake Remastered”, faces the monster, and it isn’t snappy. That is the type of effect I am trying to go for)
Although this is useful, what im going for is when the player is spotted, CFrame.lookat() immediately snaps the players camera to the monsters head. Im looking for a way to NOT make it snappy.
I believe this video could clear up some things (NOT MY VIDEO)
When the player spots The rake, instead of the camera instantly facing him, it just slightly tween/lerps to his face. That is the effect I’m trying to go for. (Sorry for any confusions in my questions)