Jailbreak Garage Viewport?

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.

Here is an example of what I am talking about.

9 Likes

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.

2 Likes

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.

https://developer.roblox.com/articles/viewportframe-gui

5 Likes

But, like I said. It causes lag when there is too many models. I don’t know how to go about this without lag.

Why not ask the developers of the game?
cc @badcc @asimo3089

1 Like

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.

Just keep experimenting! Cheers.

3 Likes

Yep, individual ViewportFrames :slight_smile:

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.

52 Likes

You could also use one camera for all viewports.

3 Likes

Thanks for confirming what @legosweat and @T0ny were saying. It was just a little confusing, but I think I know how to accomplish it now.