AR Foundation placement indicator tracking issue

Hi all,

So I am working on AR experience using the latest AR Foundation version and for some reason suddenly the tracking on the placement indicator (experience we track planes, show an indicator of some model being placed and then when user taps, the model is placed) stopped following correct positions and rotations.

First my code:

public void DisplayPlacementPointer()
    {
        raycastManager.Raycast(new Vector2(Screen.width / 2f, Screen.height / 2f), hits, TrackableType.Planes);

        if (hits.Count > 0)
        {
            if (currentPointer == null)
                currentPointer = Pooling.GetObject(pointerPrefab);

            planeFound.RaiseEvent();

            //currentPointer.position = hits[0].pose.position;
            //currentPointer.rotation = hits[0].pose.rotation;

            currentPointer.SetPositionAndRotation(hits[0].pose.position, hits[0].pose.rotation);
        }
        else
            ResetPointer();
    }

This is running in Update of course. Now the problem is that the position of the currentPointer (placement indicator in this case) is always reversed. If I move the phone upwards (i.e. looking towards the sky), the currentPointer moves downwards. If I move the phone downwards (i.e. look towards the floor), the currentPointer object moves upwards.

This is done indoors with a good lighting in the room (tried outdoors too despite the experience is setup for indoors).

I tried removing ARFoundation and adding it back again, same issue. Pretty sure there are planes detected (AR Plane Manger drew them as well as the AR Cloud).

Any ideas what is wrong here?

Hey vallar, I am pretty new to ArFoundation myself but this is what i did for my project

 var cameraForward = Camera.current.transform.forward;
 var cameraBearing = new Vector3(cameraForward.x, 0, cameraForward.z).normalized;
 hits[0].pose.rotation = Quaternion.LookRotation(cameraBearing);

Hope this helps :slight_smile: