I want an enemy to look at the player without setting its position, I just want the orientation to change. Its jittering around very weirdly which I do not like.
Is there any alternatives to CFrame.lookAt() that only set the orientation and nothing to do with the position?(i tried setting the orientation but i dont know enough math to get the orientation to lookat the player)
something i tried:
if Config.turn == true then
local tw = game.TweenService:Create(script.Parent.HumanoidRootPart,TweenInfo.new(0.05,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false),{CFrame = CFrame.lookAt(script.Parent.HumanoidRootPart.Position,v.Character.HumanoidRootPart.Position)})
tw:Play()
tw.Completed:Wait()
script.Parent.Humanoid:MoveTo(v.Character.HumanoidRootPart.Position)
end
You are using CFrame.LookAt(). CFrame.new() is what you want.
using cframe.new(vect3,vect3) will make a cframe that has the position of the first argument and have the rotation to look at the second.