- You can animate an object by changing the X, Y, and Z values of its transforms.
- When an object has a parent, its local transform describes how it is positioned, rotated, and scaled in comparison to its parent, and its world transform describes where everything is relative to the center of the world.
- You can create variables by adding them above the start function. Some are primitive types, like numbers (1, 10, 0.001, -17) or Booleans (true or false). Others are class variables, like Vector3.
- You can access these variables using “this.:” along with other properties of the UserScript, like this.game or this.entity.
- Unless they are private, these variables will also show up in the Entity panel.
- The start function runs once, right when the script loads. The tick function runs repeatedly after that, 60 times per second.
- You can write code that only runs sometimes using an if statement and a condition.
- You can also create local variables inside of a function with let, but they can’t be used outside of that function.
- You can create a function by giving it a name, and using () and then putting any code between {}
Scripting Part 1: Moving Objects
Review
You don’t have access to this lesson
Please register or sign in to access the course content.