Skip to content

Commit be29a08

Browse files
authored
Update Camera.yaml
1 parent 3c30d2f commit be29a08

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

content/en-us/reference/engine/classes/Camera.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,10 @@ methods:
12241224
the screen, for example:
12251225
12261226
```lua
1227-
local camera = workspace.CurrentCamera
1227+
local Workspace = game:GetService("Workspace")
1228+
1229+
local camera = Workspace.CurrentCamera
1230+
12281231
local viewportPoint = camera.ViewportSize / 2
12291232
local unitRay = camera:ViewportPointToRay(viewportPoint.X, viewportPoint.Y, 0)
12301233
```
@@ -1233,7 +1236,10 @@ methods:
12331236
create a longer ray, you can do the following:
12341237
12351238
```lua
1236-
local camera = workspace.CurrentCamera
1239+
local Workspace = game:GetService("Workspace")
1240+
1241+
local camera = Workspace.CurrentCamera
1242+
12371243
local length = 500
12381244
local unitRay = camera:ScreenPointToRay(100, 100)
12391245
local extendedRay = Ray.new(unitRay.Origin, unitRay.Direction * length)

0 commit comments

Comments
 (0)