function lookAt2(chr,target) if chr.PrimaryPart then local chrPos=chr.PrimaryPart.Position local tPos=target.Position local newCF=CFrame.new(chrPos,tPos) chr:SetPrimaryPartCFrame(newCF) end end lookAt2(char,v.HumanoidRootPart)
basically I'm using this function in order to make player rotate to certain target but its all choppy and not smooth so I was wondering how I could make it, I was looking everywhere and only solution was using tween service and CFrame.Angles(0,math.rad(n),0) but I need it to rotate to a certain part and I don't know how to do that with tween service and .Angles, anyone knows how I can make it work?
You should use TweenService.
local function LookAt(A, B) if not A.PrimaryPart then return end game:GetService('TweenService'):Create(A.PrimaryPart, TweenInfo.new(1), {CFrame = CFrame.new(A.PrimaryPart.Posirion, b.Position)}):Play(); end LookAt(char, v.HumanoidRootPart);
Let me know if this helps.
You should use TweenService to smoothly change values.
EDIT: Just read your question more throughly, you should use a BodyGyro inside of HumanoidRootPart to smoothly rotate the character at the desired force;