Make Character Face Camera Direction

hi, I’m trying to make a movement system with a camera lock system that orients the player towards their camera direction.

This is my code:

local Tweens = game:GetService("TweenService")
local Run = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HRP = Character:WaitForChild("HumanoidRootPart")

Run.RenderStepped:Connect(function()
	local Tween = Tweens:Create(HRP, TweenInfo.new(1,Enum.EasingStyle.Circular,Enum.EasingDirection.Out), {CFrame = CFrame.lookAt(HRP.CFrame.Position, Vector3.new(workspace.CurrentCamera.CFrame.X, HRP.CFrame.Position.Y, workspace.CurrentCamera.CFrame.Z))})
	Tween:Play()
end)

but it makes the player face… the opposite way, and I don’t know how to fix it. and Im a noob at scripting so as much detail as possible would be great.

I am not following you specifically. I am looking to help people and I check the New tab. Your post popped up and it seemed like a post I could help. Instead, it happens to be you who is the author of the post.

Well, then sorry, could you help me do it in a different way than the Shiftlock system?

UserGameSetttings.RotationType

local gameSettings = UserSettings().GameSettings
gameSettings.RotationType = Enum.RotationType.CameraRelative

This make your character rotate to your camera.

6 Likes

Oh, that easy huh? thanks!!!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.