As you can see above My Tilemap has multiple layers of which Foreground Z axis is 3, and player Z axis is 2
Its also not rendering Foreground walls.
In preview screen all looks okay but when I see it in build (window screen) not showing anything.
The render script will only draw objects within the z-range of -1 and 1. This can easily be changed by sending a message from the init() function of one of your scripts:
msg.post("@render:", "use_fixed_fit_projection", { near = -1, far = 1 })
More: The render pipeline in Defold
As an alternative you can also add a Camera component to your Player game object:
- Add Camera component to player game objects
- Check “Orthographic Projection”
- Adjust Near and Far values
- Activate the camera:
msg.post("#camera", "acquire_camera_focus")
msg.post("@render:", "use_camera_projection")
2 Likes
thanks. I actually added a Camera. So I have to add a script to Camera to acquire focus or on main.collection add a script ?
You can ad the script anywhere ads long as the url you use is correct. In my example above the script and the camera is on the same component.