How can I make the character to look left and right only? I’m not really good with CFrames so, I couldn’t figure it out myself. I only made it to follow the mouse. If someone could help, I would appreciate it.
--[[ SERVICES/VARIABLES ]]
local RunService = game:GetService("RunService")
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local mouse = Player:GetMouse()
--[[ FUNCTIONS ]]
RunService.RenderStepped:connect(function()
if Humanoid.Health > 0 then
Character.LowerTorso.CFrame = CFrame.new(Character.LowerTorso.Position, Vector3.new(mouse.Hit.p.X,Character.LowerTorso.Position.Y, mouse.Hit.p.Z))
end
end)
I’ve look into it, not really the thing I’m looking for, I have everything ready, I just don’t know how to do mouse direction thingy if the mouse is on left side plr faces left and etc.
I don’t really understand it, that’s why I’m asking for help, if that’s possible, I’m mainly a UI scripter. and never done this kind of stuff, so it’s my first time.