How can I create a performant hidden-area force field effect?

In the movie Black Panther, there’s a scene in which the main character, T’Challah, flys through a force field that hides what I assume is Wakanda’s capital:

I want to recreate this effect for a game, but I’m not sure how I would go about it in a performant manner. I want the player to join a seemingly empty game, before walking forward and seeing everything revealed. Such an effect would necessitate a huge number of parts to appear instantaneously, causing a very large lag spike.

My first idea was to run a local-sided frame-by-frame check to see if the player’s camera has crossed the force field, then setting all the parts to visible. I pretty quickly came to the conclusion that such a simple method would be unviable due to lag.

My next idea was to do the same frame-by-frame check, but instead teleporting the player to an area where everything was visible, between the time their camera is outside the force field and when it is inside. This idea was significantly more efficient, as the game would load all the parts visibly, just in a non-visible place from spawn. However, I could not find a method that teleported the player smoothly enough.

My final idea was to use an adapted version of @EgoMoose’s portal. This approach would have solved nearly all of my issues, but before I could even approach modifying EgoMoose’s script, I realized this would not work as my game uses terrain quite extensively.

Any ideas would be greatly appreciated!

1 Like

yeah i would just go with EgoMoose’s portal. However, im not sure how exactly you’re planning on doing this. And if youre looking for a dome that achieves the same effect, im pretty sure its not possible with EgoMoose because the portal script uses a GUI and GUIs dont go on the mesh, they go on the bounding box of the part.

However, you can still work around the terrain issue and the GUI issue. What i would do is have the player walk into a tunnel or hallway or wtvr where the portal effect would be. Im sure there are other creative ways to hide the terrain from view through the portal by either orienting it, or obstructing its view with other objects.

I just had an idea, just like in the video you sent, why not just design a large mountain side that the player walks into revealing the landscape hidden inside of it. And make it invis once a player is inside it

1 Like

Thank you for the idea! This reply made me realize I’ve been going about it the wrong way. By having the force field open around the player, like in the movie, the effect looks much better and is more realistic than huge areas phasing in and out of visibility based on an invisible boundary.

1 Like