INFO
Jailbreak updated their garage 2 weeks ago, which looks like it uses ViewportFrames.
PROBLEM
I have no idea how they did this. The only thing I could think of, is they put the vehicle into the ViewportFrame and set the camera circle it, which causes a lot of lag.
If anyone has any idea how they have achieved this, please tell me.
Pretty much exactly what you said… All you have to do is parent the model to the viewport frame then constantly rotate the model. I am currently working on a inventory system that works the exact same way.
You want to rotate the camera around the model. Not rotate the model.
Moving a viewport’s physical children is less performant than keeping them static. If you need to update the view, it’s better to move the camera than move the parts/models.
You pretty much nailed it, as profound as it might be, that’s exactly how they have accomplished those ViewportFrames. Now it’s all about how you come about making the code more efficient and performant on the local side of things. i.e RenderStep, etc.
Now where is it causing lag? Just the viewports? or the game entirely? Try showing less viewports? Just try to come at this with a problem and cause attitude. Find the problem, find the causes, and then formulate a solution… then repeat.
And as mentioned earlier, rotate the Camera, not the model. That’ll save you some performance. Additionally, I only update the viewportframes that are visible within the horizontal slider.