How to make player face mouse in Y axis

Hi! Title says it all! I want my player to face the y axis of their mouse.

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")
local mouse = player:GetMouse()

mouse.Move:Connect(function()
	local mouseX, mouseY, mouseZ = mouse.Hit:ToOrientation()
	hrp.Orientation = Vector3.new(hrp.Orientation.X, mouseY, hrp.Orientation.Z)
end)
2 Likes

Forummer has the solution, but here is a resource you might be interested in:

Clonetrooper’s realism makes your character’s head look towards the mouse, among other things (you can switch off the other things).

thats not what I want, it’s for an ability im making

2 Likes