Hello Devforum members!
I’m developing a game, and I need help with ViewportFrame. How ViewportFrame, Camera, etc. works, I know, but I’m faced with the problem that I’m constantly changing models in my game, so updating each new model for ViewportFrame is unnecessary work for me.
Therefore, I have been trying for a long time to make an ideal formula that will help me move the object away as much as I need it.
Suppose I have two models, they both have different sizes, but both models are on the same coordinates(Vector3.new(0,0,0)).
The size of the model can be found as follows: local _, size = model:GetBoundingBox

Size: Vector3.new(6,9,2).
The model itself is located at the coordinates(Vector3.new(0,0,12.5)), the model is located there because it is the ideal position for this model in the ViewportFrame.
How can I get 12.5 knowing these numbers(Size)?

Now this model.
Size: Vector3.new(16,15,2).
Located: Vector.new(0,0,20.83333…)
How can I get 20.8333?
If anyone has any ideas on how to implement this, please write. I apologize for my English, because it is not my native language. Thank you all in advance for your help.
