Intro to 3D Game Development

0 of 193 lessons complete (0%)

Scripting Part 3: Finishing the Game Loop

Get a Reference to the VoxelObject

You don’t have access to this lesson

Please register or sign in to access the course content.

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.

  1. In the onCollisionEnter function, create a new variable called voxelObject.
  2. Use this.entity.getComponentByType to find a particular component on this entity. 
  3. 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!