Reproduction Steps
Reproduction of this issue is trivial.
- Create a new ScreenGui inside of the StarterGui. Add a new ViewportFrame as a child of this ScreenGui. The size can be any size so long as it is greater than (1px, 1px), otherwise it is ambiguous with the unexpected result.
- Create a new Camera. Set the ViewportFrame’s
CurrentCamera
property to this camera.
Expected Behavior
When I set the ViewportFrame’s camera to a given camera instance, I expect this camera instance to update its ViewportSize
property to reflect upon the AbsoluteSize
property of the ViewportFrame.
Actual Behavior
Rather than the ViewportSize
property of the camera changing to reflect upon the size of its ViewportFrame, it remains at 1, 1
. This wreaks havoc on all calculations based on the camera, such as when using ViewportPointToRay, which behaves as if my screen is a 1x1 pixel screen. This makes actions like positioning 3D objects at a specific pixel coordinate require convoluted workarounds to work correctly.
Workaround
Currently, my workaround uses the fact that my ViewportFrame takes the full resolution of the screen, and has a camera identical to workspace.CurrentCamera
. Because of this, I can do my calculations on workspace.CurrentCamera
instead of the viewport camera.
Issue Area: Engine
Issue Type: Other
Impact: Moderate
Frequency: Constantly