Haha whoops! Thank you!
I changed it to 500x500 and reuploaded to the OP!
Haha whoops! Thank you!
I changed it to 500x500 and reuploaded to the OP!
Why would you say
THIS IS NOT SUITABLE FOR A PRODUCTION GAME ENVIRONMENT. It is an interesting tech demo prototype, but is absolutely an abuse of ViewportFrames. Note that it slows exponentially- the more objects, the slower it gets. Iāve optimized plenty, but it is not enough.
If it works fine at 60fps? As long as youāre not cloning players every single frame, but updating their CFrame and running animations locally it should work perfectly fine in a production game.
I had a project where I rendered every single player locally, updated their position and animation every couple of frames and it worked perfectly fine with over 100 players at once. (This was on top of many other calculations like inverse kinematics and other game logic running at the same time)
Youāre forgetting something. Iām not just moving parts, Iām moving them inside a ViewportFrame! This means the frame has to render all over again!
Although I did optimize plenty, when you add even more parts it will slow the refresh rate of the ViewportFrame. The game will run at 60FPS still, but the scope will look laggy.
Also, the ViewportFrame itself is not good in many situations. It canāt render terrain, particles, or complex lighting!
Ah I see, if the ViewportFrame didnāt slow down then it wouldnāt be a problem.
Fixed the bugs, and uploaded the patched file to the OP!
Also, the ViewportFrame itself is not good in many situations. It canāt render terrain, particles, or complex lighting!
There is still this, however.
I never even thought of using ViewportFrames for this kind of stuff, good thinking!
Yes!!! I have a prototype working for blurring the world but not the scope!
Told you I was working on that
Updated the OP to have this new feature!
Okay thatās epic. Now Iām tempted to indulge on this abuse of features for my projects and Iāve gotta praise you for sharing this resource.
This is simply amazing.
I updated the OP to explain this, and give the new file. (Along with fixes and optimization)
This is really cool. However, it demonstrates that it would be really nice to be able to simply throw additional cameras into the world and render them on a frame
One can only dreamā¦
But Iāll make hacky things in the meantime
Try to make something as smooth and as seamless as portals from Portal / Portal 2. I plan on doing something similar, but with the hacky teleporting thing which is kinda bad imo.
Something like this:
I donāt know if itās entirely possible to shunt things through two āportalsā like a laser properly. Could be wrong however.
What a great gameā¦ good memories.
Now, portals are a very curious thing, because you have to be able to look in it at angles and see different thingsā¦ I will give it a go.
Later. Iām pretty tired of ViewportFrames by now. Thatās what happens when you spend ~25 hours within a 48 hour period working on them.
Edit:
Who am I kidding, I canāt resist a challenge!
See, I think itād be pretty easy, though I canāt have the proper angle thing, plus I canāt make it so players and objects and lasers seamlessly pass through them.
Iām still relying on the teleport method.
Oh yeah, I have no clue how to make it teleport well.
Perhaps when Roblox adds the rest of the features to viewport frames, thisāll be possible?
I know theyāll be adding in the rest of the effects to ViewPortFrames later on, like lighting, particles, and possibly surface / billboard guis.
This is super cool. I took a shot at making a night vision scope.
https://gyazo.com/847e8d5a1463cd486036f55eb2fd05c7
Not too hard to do, just make the lighting super dark and then add a green frame behind the scope image. Turns out pretty cool, if I do say so myself.
Night vision scope.rbxl (1.2 MB)
That looks super awesome!
Youāll want to set the green frame to have a border pixel size of 0, or you can see the square of the Viewport. Donāt ruin the illusion!