Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How to raycast a camera?

Asked by 9 years ago

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

0
You don't have to point out that this isn't a request. Also, what exactly do you mean by "raycast a camera"? adark 5487 — 9y
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 GreekGodOfMLG 244 — 9y

1 answer

Log in to vote
1
Answered by
Tkdriverx 514 Moderation Voter
9 years ago

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.

Ad

Answer this question