Dimension Portal System
A downloadable game
FOR UNITY
The project simulates two distinct worlds, World A and World B, each containing different objects and behaviors. The player can spawn a portal that reveals elements from the alternate world within a defined area.
When the portal is active:
- Objects from the other world become visible only inside (or outside) the portal mask.
- Collisions are dynamically adjusted so the player can interact only with the visible parts.
To achieve this effect, platforms are divided into multiple smaller collider segments. These segments individually react to the portal’s presence, allowing only the intersecting parts to become solid.
This creates the illusion of a seamless transition between worlds while maintaining accurate gameplay interactions.
The system is built using Unity and relies on a combination of layers, sprite masks, and dynamic collider management.
Key components:
- Layer system: Two layers (WorldA and WorldB) are used to separate objects and control visibility and interaction.
- Portal system:A portal can be spawned dynamically and can either appear instantly or grow over time. It uses a sprite mask to control which parts of objects are visible.
- Collider subdivision:Platforms are divided into multiple child objects, each with its own collider. This allows fine-grained control over which parts are solid or passable.
- Dynamic collision handling:Colliders switch between trigger and non-trigger states depending on whether they intersect the portal.
- Performance considerations:Increasing the number of collider segments improves precision but may impact performance.
Main scripts:
- PlayerController: Handles player movement.
- EnemyController: Manages enemy behavior across both worlds.
- PortalSpawner: Handles portal creation and growth.
- PortalController: Manages world interaction and layer logic.
- AutoColliderGrid2D: Automatically splits objects into multiple colliders.
Download
Click download now to get access to the following files:

Leave a comment
Log in with itch.io to leave a comment.