[SOLVED] Logging the position of an entity to the console

Hi all,

is there a way to log the position of an entity to the console?

Thanks

You can do something like this:

// print the current world position of an entity
console.log(this.entity.getPosition());

// print the current local position
console.log(this.entity.getLocalPosition());

// get pos in the X and Z axis
console.log(this.entity.getPosition().x);
console.log(this.entity.getPosition().z);

Or if you want to get fancy:

console.table(this.entity.getPosition());

1 Like

Thanks a lot @Leonidas!