Closed EliteAsian123 closed 5 years ago
Short answer: noa.ents.getPosition(noa.playerEntity)
Long answer: entity data all lives in components, and entity positions live in the position
property of the state object of the position
component. So the explicit way to get the data would be:
var entID = noa.playerEntity // 1
var compName = noa.ents.names.position // "position"
var posdata = noa.ents.getState(entID, compName)
console.log(posdata.position)
However the entities
module defines a bunch of accessors for often-used data, here is where they're all defined.
By the way, noa
entity positions are always the bottom-center of the entity's AABB.
Okay thanks!
How do I get the position of let's say, the player?