Da_Fr0st
(Frost)
June 24, 2022, 1:19pm
#1
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]
Judgy_Oreo
(phoenixwhitefire2000)
June 24, 2022, 2:15pm
#2
They are baked. But resizing and visibility changes are considered event to update the baked image.
Unless you are updating the contents of the ViewportFrame or resizing the ViewportFrame, it’ll be rendered once and used as an image.
Da_Fr0st
(Frost)
June 24, 2022, 2:17pm
#3
I worded it wrong, its not really am image as it is updated. It is essentially a live feed.
Judgy_Oreo
(phoenixwhitefire2000)
June 24, 2022, 2:24pm
#4
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?
Da_Fr0st
(Frost)
June 24, 2022, 2:26pm
#5
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
Judgy_Oreo
(phoenixwhitefire2000)
June 24, 2022, 2:29pm
#6
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 .
Da_Fr0st
(Frost)
June 24, 2022, 2:32pm
#7
roblox renders non stop which lags
Judgy_Oreo
(phoenixwhitefire2000)
June 24, 2022, 2:33pm
#8
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.
Da_Fr0st
(Frost)
June 24, 2022, 2:36pm
#9
Is my script wrong then? Do I need to change it so it doesn’t render?
DataSigh
(DataSigh)
June 24, 2022, 2:38pm
#10
What the other dude is trying to say is that it wont refresh unless something in the viewportframe changes.
Judgy_Oreo
(phoenixwhitefire2000)
June 24, 2022, 2:38pm
#11
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 .
Da_Fr0st
(Frost)
June 24, 2022, 2:40pm
#12
Can you tell me how to set up a viewport correctly? where i dont have to render it?
Judgy_Oreo
(phoenixwhitefire2000)
June 24, 2022, 2:42pm
#13
Listen, I have no idea if you’re trolling or something, but I’ve literally been telling you,
YOU DON’T NEED TO DO ANYTHING AT ALL
Just read my replies if you don’t understand. I’ve made it as clear as possible.
Da_Fr0st
(Frost)
June 24, 2022, 2:47pm
#14
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