How to render viewports?

I have a script that renders based of a camera position. I used viewports for this, but im not sure one a few things, How would I render users, with their clothing and accessories and make the viewport only re-render if the camera cframe changes or a player has moved. This is so that it reduces lag.

These are the file:

This is the localscript for the cams:

[Removed For Privacy/Copyright] 

Unless you are updating the contents of the ViewportFrame or resizing the ViewportFrame, it’ll be rendered once and used as an image.

I worded it wrong, its not really am image as it is updated. It is essentially a live feed.

And unless anything changes the ViewportFrame won’t re-render and will use an older frame for better performance?

Which, from what I can tell, is exactly what you want?

Basicly i only want the viewport to render if the camera position has changed or if a player has moved to minimise the amount of times the viewport has to rerender

That already happens automatically.

I’ve literally been telling you that. You don’t need to write any code because ROBLOX DOES IT FOR YOU.

roblox renders non stop which lags

The first reply I sent literally 15 minutes ago quotes a STAFF MEMBER saying that ViewportFrames don’t render unless the content changes.

Roblox themselves have said that ViewportFrames automatically do not render unless their contents change.

Is my script wrong then? Do I need to change it so it doesn’t render?

What the other dude is trying to say is that it wont refresh unless something in the viewportframe changes.

I have no idea what the script is even trying to do, because you can’t force a ViewportFrame to render unless you make an update to it’s contents, but you don’t need the script for what you are trying to do. Roblox does it for you. You don’t need to do anything.

Can you tell me how to set up a viewport correctly? where i dont have to render it?

Listen, I have no idea if you’re trolling or something, but I’ve literally been telling you,


Just read my replies if you don’t understand. I’ve made it as clear as possible.

I still don’t understand…
Also their documentation is not helpful. I’m not rendering one item, I’m rendering the entire workspace.
ViewportFrame GUI