I found a bug while the sample scene for the Meta Quest 3 headset.
While testing the ‘Device Mapping’ sample scene, I noticed that nothing happens after scanning the room.
Upon checking the scene, I noticed two things:
-
The ‘Default Anchor GameObject’ prefab referenced to the AR Persistent Anchor Manager script, is an empty GameObject. So, we can’t see the anchor, maybe adding a 3D model of the anchor will help.
-
In the same scene, clicking the “Place Cube” button does not do anything, and that’s because I am using URP, and it seems like just creating the primitive is not enough.
We need to add reference material as well. After I edited the OnDevicePersistence script, I was able to see the cubes.Code
[SerializeField] private Material _cubeMaterial; // Added this line
///
/// Managing the cube placement/storage and anchoring to map function
///
private GameObject CreateAndPlaceCube(Vector3 localPos)
{
var go = GameObject.CreatePrimitive(PrimitiveType.Cube);
Debug.Log("Creating Cube at: " + localPos);
go.GetComponent().material = _cubeMaterial; //Added this line
//add it under the anchor on our map.
_tracker.AddObjectToAnchor(go);
go.transform.localPosition = localPos;
//make it smaller.
go.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f);
return go;
}
- Issue category: Unity Example Package, Niantic Lightship Meta Plugin Samples v3.15.0
- Sample Scene: Device Mapping
Bug reproduction steps:
- Follow this documentation for building samples to the Quest 3 headset: Sample Projects | Niantic Spatial Platform