Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to keep objects within a viewport and not clipping through the sides?

Asked by 5 years ago

With the release of viewports, I’ve been concerting my items into 3d rotating ones in the stats menu. But one thing I’ve been struggling with is keeping the object within the viewport Gui as they all vary in size. Firstly I CFrame the model into where the camera is for the viewport, and then find out which side is the biggest (X, Y, Z) and move it back depending on this offset. But this isn’t too effective, some models end up being tiny, whilst some are still clipping.

What is the fancy maths behind this?

Answer this question