Need help so character follow camera while autorotate is off

  1. What do you want to achieve? Keep it simple and clear!
    wanted to make so that character still follow camera while autorotate is off
  2. What is the issue? Include screenshots / videos if possible!
    make player follow camera while autorotate is off (like is autorotate is on but its not)
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i cant really find one cuz no one search things like this
    well…

this is the code i’ve had im my head but it didn’t work as expected.
heres the script that didn’t work:


local humanoid = script.Parent:WaitForChild("Humanoid")


local humRootPart = script.Parent:WaitForChild("HumanoidRootPart")
local rotX = math.deg(math.atan2(humanoid.MoveDirection.Z, humanoid.MoveDirection.X)) + 90
if humanoid.MoveDirection ~= Vector3.new(0, 0, 0) then
	--print(rotX)
	bodyRot = bodyRot:lerp(CFrame.Angles(0, -math.rad(rotX), 0), 0.125)
	humRootPart.CFrame = CFrame.new(humRootPart.CFrame.p.X, humRootPart.CFrame.p.Y, humRootPart.CFrame.p.Z) * bodyRot
end

any help would be appreciated.

i forgot the video:


it didn’t work as well

Nevermind, i’ve found a script and removed the no-cool parts and done

1 Like
local Game = game
local Workspace = workspace
local RunService = Game:GetService("RunService")
local Players = Game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = Workspace.CurrentCamera

local function OnRenderStep()
	local Pivot = Character:GetPivot()
	local _, Y, _ = Camera.CFrame:ToOrientation()
	local X, _, Z = Pivot:ToOrientation()
	Character:PivotTo(CFrame.new(Pivot.Position) * CFrame.fromOrientation(X, Y, Z))
end

RunService.RenderStepped:Connect(OnRenderStep)

thats better thanks sir… the script worked lol thats better also