How would you build portals or the Tardis in Unity?

How would you go about building rooms, vehicles and sub-worlds in Unity that have ‘magical’ or Tardis, larger on the inside, like dimensions?

Let’s say you build a fantasy castle and fit all the rooms then realise it would be cool to have magical or hidden/secret rooms and passageways…

You could re-build your castle model or could you add in portal style rooms and passageways that don’t fit into the physical spaces provided but work in game… how would you do this in Unity?

2 Likes

Seems like a pretty good tutorial on the subject, at the very end his implementation does appear pretty smooth.

I thought Unity could handle separate multiple scenes would a multi-scene solution work?

Sure, but the problem is connecting those scenes.

If you have a fixed model of your map/castle, loading in other scenes by itself won’t help add rooms (especially when those rooms won’t physically fit). You need to smoothly teleport the player from one location to another, and like you say in the title, “portals” are probably the best ways to do this.

You could, load in your “secret room” as a secondary scene, but you still need to fit it into the environment and let the player move between rooms.

I would use coding and algorithms.

7 Likes

So you can’t portal scenes within scenes?

I’m a swearing and hacks man myself.

3 Likes

The trick is having two rooms appear to take the same physical location, and that’s where you need some trickery (portals). What objects exist in what scene doesn’t really matter so much.

Let’s say you wanna make a tiny little castle that appears 5x5 on the outside but 100x100 on the inside. You fake the ‘doorway’ (portal), and make passing through the doorway secretly teleport you to the interior.

It doesn’t matter if the castle exterior and interior are in different scenes or not. It just matters that you place the interior at a different position, then use some trickery (portals) to teleport smoothly between the two locations

1 Like

You’d just have to load both scenes at the same time, so then it would really be just the same as that video that frosted posted.

Stencil buffee portals are probably hard to beat performance wise

transform.position = someWhereElse;
2 Likes

:sunglasses:

That does not solve the camera problem of looking into the Tardis?

Corners. Sometimes the old ticks are the best ones.

https://assetstore.unity.com/packages/vfx/shaders/fake-interiors-free-104029

The video at the beginning of the thread solves the issue using a render texture, a seperate camera for the portal and a script.

We looked at this free plugin before we made our own custom system for our sniper scopes

What are you smoking??