Spark AR studio, get position of object in v100+

I am super lost in the jungle that is the documentation of SparkAR. I am trying to get the coordinates of a plane inside of the script editor, to use in collider detection, but I can’t seem to get the right results. I need a 2d vector output with the x and the y axis, but all documentation I could find was in lower versions. I am able to get the x position of an obejct using:

plane4.worldTransform.x.monitor().subscribe(function (posX) {
  Diagnostics.log(posX.newValue);
});

But this only prints the x value and I want to use the coordinates inside of the Patch Editor using From Script. Anybody that can help me with this, is greatly appreciated.

64 thoughts on “Spark AR studio, get position of object in v100+”

Leave a Comment