Next we need to change the way the voxel button looks when you step on it. To do that, we need a reference to this entity’s voxelObject.
- In the onCollisionEnter function, create a new variable called voxelObject.
- Use this.entity.getComponentByType to find a particular component on this entity.
- Give ComponentType.VoxelObject as the input so that we are looking for a VoxelObject.
Curious about the different ComponentTypes? Check out the full list here!