selene icon indicating copy to clipboard operation
selene copied to clipboard

Lint probably incorrect uses of ScreenPoint functions vs ViewportPoint functions

Open Kampfkarren opened this issue 2 years ago • 0 comments

	local mouseLocation = UserInputService:GetMouseLocation()
	local worldPosition = Workspace.CurrentCamera:ScreenPointToRay(mouseLocation.X, mouseLocation.Y

...is very subtly wrong, and will be offset, which you sometimes want, but not with mouse location.

	local mouseLocation = UserInputService:GetMouseLocation()
	local worldPosition = Workspace.CurrentCamera:ViewportPointToRay(mouseLocation.X, mouseLocation.Y)

...is correct.

Kampfkarren avatar Jan 03 '23 23:01 Kampfkarren