You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en-us/reference/engine/classes/Camera.yaml
+12-6Lines changed: 12 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1177,14 +1177,20 @@ methods:
1177
1177
at a given depth from the `Class.Camera`, orientated in the camera's
1178
1178
direction. Does not account for the `Enum.ScreenInsets|CoreUISafeInsets` inset.
1179
1179
description: |
1180
-
This function creates a unit `Datatype.Ray` from a 2D position in device safe viewport coordinates (defined in pixels). That is, `(0, 0)` corresponds to the top left point of the Roblox top bar.
1180
+
This function creates a unit `Datatype.Ray` from a 2D position in device safe viewport coordinates,
1181
+
defined in pixels. That is, `(0, 0)` corresponds to the top-left point of the Roblox top bar. The input
1182
+
2D position does **not** account for the `Enum.ScreenInsets|CoreUISafeInsets` inset, but it does
1183
+
account for any `Enum.ScreenInsets|DeviceSafeInsets`.
1181
1184
1182
-
<img src="/assets/engine-api/classes/Camera/DeviceSafeViewportCoordinates.jpg" width="720" alt="Diagram showing the origin of the device safe area viewport coordinate system." />
1183
-
1184
-
The input 2D position does **not** account for the Core UI inset, but does account for any device safe insets.
1185
-
The `Datatype.Ray` originates from the `Datatype.Vector3` equivalent of the 2D position in the world at the given depth (in studs) away from the `Class.Camera`.
1185
+
<img src="../../../assets/engine-api/classes/Camera/DeviceSafeViewportCoordinates.png" width="840" alt="Diagram showing the origin of the device safe area viewport coordinate system." />
1186
+
1187
+
The `Datatype.Ray` originates from the `Datatype.Vector3` equivalent of the 2D position in the
1188
+
world at the given depth (in studs) away from the `Class.Camera`.
1186
1189
1187
-
Note that UI instances use a different coordinate system. `Class.GuiObject.AbsolutePosition` uses the Core UI viewport coordinate system, while this function uses the device safe viewport coordinate system. If you would like to specify position in Core UI coordinates, please use
1190
+
Note that UI instances use a different coordinate system. `Class.GuiObject.AbsolutePosition` uses
1191
+
the `Enum.ScreenInsets|CoreUISafeInsets` viewport coordinate system, while this function uses the
1192
+
`Enum.ScreenInsets|DeviceSafeInsets` viewport coordinate system. If you would like to specify
1193
+
position in core UI coordinates, please use
1188
1194
`Class.Camera:ScreenPointToRay()`.
1189
1195
1190
1196
This function only works for the current Workspace camera. Other cameras,
0 commit comments