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

How to raycast a camera?

No, this is not a request, it's a question where I want sources to. Are there any? Thanks!

2 comments

0

You don't have to point out that this isn't a request. Also, what exactly do you mean by "raycast a camera"?

0

if a player is in view of someone, i want a gui to be activated, and i think it'll be eqsier raycasting the camera

1 answer

✓ Accepted answer

I can tell the basis of what points you use, etc.:

Use the Camera's CoodinateFrame and cast a ray from that point (use .p to get the position of the CoordinateFrame (which is a CFrame)) to the player. If it hits other parts beside the player, it doesn't display your gui. Otherwise, if it hits a part of the player, then display your gui.

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