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.