Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there a way to know where a player is looking?

Is there a way to know where a player is looking, say if they are looking down (Angle of depression) or up (Angle of Elevation), and can you know the angle they are looking down at. (I'm not even sure if the camera has rotation properties or not) Preferably I wouldn't want to use a part, and check if the part is in the camera, because I intend for it to be a Third-Person game.

I know you can get the current camera through:

game.Workspace.CurrentCamera

3 answers

✓ Accepted answer

Not exactly the angle, but you can know the position where it's facing. It's called CoordinateFrame. It's a property of the Camera and defines the CFrame position. Hope this helped,

2 comments

0

Helped me enough

0

Glad I could help.

I've found some of this information from a few other questions.

But do you this you need to use lookVector. it is a property of CFrame which allows you to access which way an object is facing. I dont know if this answers your question properly or not, But if it does, make sure to accept the answer :)

1 comment

0

Can I have an example of look vector being used?

Sry I can't Comment, so if u want to see how lookVector is being used,

--if u for example want to change the Part's Velocity into a certain direction then,
Part.Velocity = Part.CFrame.lookVector * 100 --pretend that Part is defined

sry but, I don't know other examples to show u :/

1 comment

0

I mean not 'in certain direction' but to the direction that the Part's Front Surface is Facing...

This discussion is preserved as it was. New answers, comments, and votes are closed.