Masking Objects

This project demonstrates the hiding of objects in a scene using invisible mask objects. This technique is useful for creating expansive environments that are behind a target image. You can find this example project within the New Project modal in ZapWorks Studio.

The Project

In this example the environment is in the allObjects group. Each of the objects in that group have their layerMode property set to test_3d meaning that they will be hidden behind objects that are closer to the camera. The SquareMask0 object is very large but has a hole in the center from -1 to 1 in both X and Y. It's layerMode property is set to full_3d and it's color opacity is set to 0. This means that it will hide the objects behind it in 3D space. Because this object appears before allObjects in the hierarchy it will be drawn to the screen first.

Editing the Project

Follow the step-by-step tutorial to set up the project from scratch using your own images and assets.

zapcode branded_zapcode i