1. Home
  2. Docs
  3. Game Factory Documentatio...
  4. Coding
  5. Moving in world space

Moving in world space

All of those move in actor space. Now let’s see how we’d move in world space. Suppose for example that you wanted to move the slime north, no matter where it’s facing. In this case you can use the moveGlobal function, which moves an actor with a world-space velocity:

  export function onTick() {
    // Move north.
    moveGlobal(vec3(0,0,1));
  }
  

Note that the slime is moving towards the world’s north direction regardless of where it’s looking. That’s why it moves sideways.

How can we help?

Search this website Type then hit enter to search