Title says it all, the documentation for Camera:WorldToViewportPoint
uses the old raycasting API, so it should be updated to use the new one.
It also uses the deprecated p
property of CFrame so it should just use Position
now.
And, while pedantic, I believe that camera
should be defined outside of the function body since it is a constant