# Augmented Reality | Help!

**URL:** <https://discourse.processing.org/t/augmented-reality-help/28301>\
**Category:** Processing for Android\
**Created:** [March 6, 2021, 5:10pm UTC](https://discourse.processing.org/t/augmented-reality-help/28301 "2021-03-06T17:10:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brittneyjuliet](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@brittneyjuliet](https://discourse.processing.org/u/brittneyjuliet)\
**Post date:** [March 6, 2021, 5:10pm UTC](https://discourse.processing.org/t/augmented-reality-help/28301/1 "2021-03-06T17:10:46Z")

</div>

Hi All,

I’m working with ar within Processing for Android’s framework and I seem to have gotten stuck. I’ve utilized Andres Colubri’s [fantastic] tutorials at [android.processing.org](http://android.processing.org) as well as the included ar tutorials included with Processing’s ar library to create an incredibly simple implementation of ar:

```
import processing.ar.*;

ARTracker tracker;
ARAnchor anchor;

float angle;

void setup(){
fullScreen(AR);

tracker = new ARTracker(this);
tracker.start();

fill(37, 148, 179);

}

void draw(){
lights();

if (mousePressed){
//create new anchor at the current touch point
if (anchor != null) anchor.dispose();
ARTrackable hit = tracker.get(mouseX, mouseY);
if (hit != null) anchor = new ARAnchor (hit);
else anchor = null;
}

if (anchor != null){
anchor.attach();
rotateY(radians(angle));
box(.1);
anchor.detach();
}

angle = angle + 1;

}

```

With the above code, I’m able to place a rotating cube on an x, y, z coordinate within a particular physical space - I haven’t bothered with drawing trackable planes because I don’t believe it to be necessary for what I’m trying to achieve.

My Question: How can I add multiple objects (in this case, cubes) to the scene? I’d love to be able to anchor 3-4 objects to x, y, z coordinates that can then be further manipulated or animated.

I feel it has something to do with detaching the anchor, however when I removed the anchor.detach() function the app crashed on me.

Any help or nudge in the right direction will be greatly appreciated 🙂

Thank You!!!

-Brittney

---

<div class="post-metadata">

**Author:** ![brittneyjuliet](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@brittneyjuliet](https://discourse.processing.org/u/brittneyjuliet)\
**Post date:** [March 14, 2021, 2:15am UTC](https://discourse.processing.org/t/augmented-reality-help/28301/2 "2021-03-14T02:15:42Z")

</div>

For anyone who’s interested, Andres Colubri created another example sketch demonstrating how to create multiple anchors and touch events. Feel free to check out the example here:

> <https://gist.github.com/codeanticode/73ba7ff0b5b41baf6516f86377c2dcdc>
