Using the Billboard node
In this recipe, we will create a MeshInstance3D with a BoxMesh. We use the visual shader Billboard node so that the MeshInstance3D will always face the camera.
Getting ready
For this recipe, click + to the right of the VSContextMenu
scene we just completed to add a new scene. In the Scene tab, click 3D Scene. Click on the word Scene in the top-left corner next to Project, then select Save Scene As, and name it Billboard
.
How to do it…
Let’s create MeshInstance3D and then add the visual shader:
- Left-click on the Node3D node and then press the + sign in the Scene tab. In the Create New Node window, type
mesh
in the Search box and then select MeshInstance3D to create the node in the scene. - In the Inspector, click on <empty> to the right of Mesh and select New BoxMesh.
- Left-click on the same place to open the properties of the MeshInstance3D.
- Click on <empty> to the right of Material in the Inspector and...