Making ViewPort Frame show a POV in workspace

Hello Developers!

I’m currently in the midst of a new game that I dropped a while back, and just kind of decided to finish it. The game is about running in a hallway, to the end. There are various obstacles that each server has randomized. Now what I want, is to show the camera point of view of “The Wall” which is just a Neon Red wall that moves from the beginning of the hallway to the end, prompting the player to run towards the end. I want a viewport frame to show it’s POV, and I want everything to be seen, like the tables, players and stuff like that.

How can I do this?

Thanks in advance,
OceanTubez

2 Likes

I wouldn’t use a viewport frame for this, what I would do though is just using :BindToRenderStep and setting the position of the player’s CurrentCamera to the wall’s CFrame.

If you could show some code, I can help implement it.

3 Likes

No no, I want to have a sort of display on their screen, like a frame, which shows how far the wall is from the player. Instead of displaying how far it is from the player, I wanted to have more immersion and wanted a frame to show the action behind them, from the walls POV.

I have no code at the moment, but I think it’s possible.

1 Like

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

I would recommend using @boatbomber’s viewport frame handler for this: ViewportFrame Camera System - #59 by boatbomber

I made an example place for you to test and get the code from, but you should probably search things up like this before posting:
WallCamera.rbxl (56.3 KB)

Code is in StarterGui, there are comments to help you implement it in your own project.

1 Like

I didn’t want an entire system, just a basic concept. I would build off of at, but I get what you are trying to say.

1 Like

Thank you! I got the basic proof of concept down from this. I’ll update this post with the final result.

I have encountered a bit of a problem, see my sections are up to 22500 studs long. And after a certain distance, they stop rendering. After that, even the players stop rendering.

You could try creating new handlers every few intervals, so it reloads the areas that would usually stop rendering.

I will try that. I might archive this feature for now, maybe come back to it later.

Don’t be that kind of guy, he’s aksing for help smh…

@OceanTubez maybe for the bit rendering issue you can add some fog for the viewport

Why not put each player’s viewport camera 30 or 40 studs ahead of them as they move and script it so it travels at the same speed they are so it sees everthing in the player’s area. This will also help with the load on the server since it would be handled on the client’s computer.

Seems it wouldn’t be too tough if you had the entire game set on (for example) the X axis, then you could CFrame the camera at +40 studs from the player’s position on the X axis and leave the Y and Z values the same.

You’re asking waaaay too much for the camera to be able to ‘see’ 22500 studs.

Yeah, but I have found a fix. Which is on set intervals, make a new handler. It should work, but as of right now I’m working on something else which is necessary to the game.