Skip to content

Commit

Permalink
Added missing info
Browse files Browse the repository at this point in the history
  • Loading branch information
EmeraldSlash committed Aug 27, 2021
1 parent 5fd55d8 commit 659b022
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -630,7 +630,13 @@ bool RbxMouse.FILTER_VISIBLE_OR_CANCOLLIDE(RaycastResult result)

# Contrived examples

More complicated raycasting with any ray, RaycastParams, and a filter function:
Perform a simple raycast, hitting anything:

```lua
local result = RbxMouse:GetTarget()
```

More complicated raycasting with RaycastParams, a filter function, and a ray:
```lua
-- Ignore the player's character.
local params = RaycastParams.new()
Expand All @@ -644,6 +650,9 @@ local ray = Ray.new(origin, direction)
local result = RbxMouse:GetTarget(params, RbxMouse.FILTER_CANCOLLIDE, ray)
```

As you can see, RbxMouse is flexible enough that you can use it as a
raycasting library in its own right.

Raycasting from center of screen and only hitting very specific parts:

```lua
Expand Down

0 comments on commit 659b022

Please sign in to comment.