Intro to 3D Game Development

0 of 193 lessons complete (0%)

Scripting Part 1: Moving Objects

Write an ‘If’ Statement

You don’t have access to this lesson
Please register or sign in to access the course content.

We can use an if statement to have code that only runs if a particular condition is true.

  1. Write an if statement in the tick function, right above the line that moves the chest:
    • if(this.shouldChestMove){}
  2. Take the second curly bracket } and move it below the this.entityline.
  3. Put your cursor right before the this.entityline, and press Tab to indent