title: ARCore unity - Place objects between two objects
body: <p>Using ARCore on Unity, I'm trying to place one gameObject between two gameObjects. Unfortunately it doesn't display, it seems it is a problem with Anchor.</p>
  
  <p>*Using Vuforia, i didn't had problem to position game objects.</p>
  
  <p>What i try to achieve is:</p>
  
  <ol>
  <li>Place two objects (A and B) on the ground when i touch the surface. It Works</li>
  <li><p>Place a gameObject (C) between the two objects (A and B).Not displaying</p>
  
  <pre><code>// Place target objects A and B on surface touch
  
  GameObject prefab;
  GameObject prefab2;
  prefab = AndyPointPrefab;
  prefab2 = AndyPlanePrefab;
  
  hitpoint= hitpoint + 1;
  
  // Place object A
  
  if (hitpoint==1){
  
    target1 = Instantiate(prefab, hit.Pose.position, hit.Pose.rotation);
    target1.transform.Rotate(0, k_ModelRotation, 0, Space.Self);
    var anchor = hit.Trackable.CreateAnchor(hit.Pose);
    target1.transform.parent = anchor.transform;
    mIsFirsttargetVisible=true;
  
  }
  else if (hitpoint==2){  // Place object B
  
   target2 = Instantiate(prefab2, hit.Pose.position, hit.Pose.rotation);
   target2.transform.Rotate(0, k_ModelRotation, 0, Space.Self);
   var anchor = hit.Trackable.CreateAnchor(hit.Pose);
   target2.transform.parent = anchor.transform;
   mIsSecondTargetVisible=true;
   hitpoint=-1;
  
  }
  
  //Update function : todisplay point C in-between.
  Update() {
  
  // Place object C
  
  if(mIsFirsttargetVisible &amp;&amp; mIsSecondTargetVisible){
  GameObject objectMiddle = GameObject.CreatePrimitive(PrimitiveType.Sphere); 
  Vector3 middlePosition =  (target1.transform.position+target2.transform.position)/2;    
  objectMiddle.transform.position = middlePosition;
  objectMiddle.transform.localScale = new Vector3(200.0f, 10.0f, 200.0f);
  }
  }
  </code></pre></li>
  </ol>
  
  <p>EDIT</p>
  
  <p>I successfully arrived to place the gameobject in between.</p>
  
  <p>i added this last line in my code:                                  target1.transform.parent = objectMiddle.transform;</p>
  
  <pre><code> if(mIsFirsttargetVisible &amp;&amp; mIsSecondTargetVisible){
      GameObject objectMiddle = GameObject.CreatePrimitive(PrimitiveType.Sphere); 
      Vector3 middlePosition =  (target1.transform.position+target2.transform.position)/2;    
      objectMiddle.transform.position = middlePosition;
      objectMiddle.transform.localScale = new Vector3(200.0f, 10.0f, 200.0f);
      target1.transform.parent = objectMiddle.transform;
      }
  </code></pre>