Detect when player looks down/aims downards

Hello, I want to execute code when a player is aiming downards or looks downards. I’ve tried doing this with

(game.Players.LocalPlayer.Character.HumanoidRootPart.Position - Mouse.Hit.Position).Unit

but depending on when the character jumps or not it changes numbers so I cant really rely on it to detect correctly.

workspace.currentCamera.CFrame.Y

I’ve also used this but i’m too stupid enough to understand how it works and it doesnt really reliabley provide the output im looking for.

any help would be appreciated.

Put code in a local script in StarterCharacterScripts

local cam = workspace.CurrentCamera
if cam.CFrame.LookVector < -0.5 --[[ If LookVector is negative then player's
head is tilted downwards, so less than -0.5 means player is completely looking down]]--

Thank you, forgot the Y though.

There doesn’t need to be a Y, since you just need to check whether the look vector is negative if you’re facing downwards

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