Is it possible to spawn a prefab once the camera detects a reference image and then immediately anchor this and not allow it to move when the reference image is no longer in view? I’m attempting to spawn a very large prefab when a user scans a QR code located on the floor and then have them be able to look up and walk around the prefab without it moving once the QR code is no longer visible.
I’d done this by setting the position and orientation of the spawned prefab manually when it’s generated, rather than parenting it to the image:
void OnChanged(ARTrackedImagesChangedEventArgs eventArgs){
foreach (var trackedImage in eventArgs.added){
if (trackedImage.referenceImage.name=="trigger_mushroom"){
GameObject shroom = Instantiate(mushroomPrefab, trackedImage.transform.position, trackedImage.transform.rotation);
}
}