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

How is Mouse.UnitRay used? [Examples]

Asked by
Radstar1 270 Moderation Voter
6 years ago
Edited 6 years ago

So I was reading up on it and it's a ray that extends from the camera to the player's mouse, which sounds pretty useful to me.

What is the correct way to use it? [Code Example] I don't need anything fancy, but it just confuses me.

Can it be used to show when you have locked on someone when your mouse hovers over them?

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

According to the wiki:

Ray UnitRay [readonly]

A ray starting from the player's Camera and traveling in the direction where the player's Mouse is projecting in the world.

So I'd say like a line from where the camera is to where the mouse is, but I might be wrong, don't quote me on that.

Ad

Answer this question