Hi, the following code is returning NaN. Why is this? Is this the best way (position)to get the x position of an entity?
var position = instance.getLocalPosition();
No. A pc.Vec3 doesn’t have array access. Use
.x Vec3 | PlayCanvas API Reference
Okay Thanks. I was just going from the manual here: Entity | PlayCanvas API Reference
Ugh. Thanks for pointing that out.
Once upon a time, it used to be an array but was removed for performance reasons
Edit: PR made: Updated docs from array format of node.position to vec3 by yaustar · Pull Request #3332 · playcanvas/engine · GitHub