Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Exclude GameObject transform from being controlled by AR

Discussion in 'AR' started by mb13admin, Sep 24, 2023.

  1. mb13admin

    mb13admin

    Joined:
    May 28, 2017
    Posts:
    22
    Hi, I'm working in AR Foundation with simple plane detection and object placement in AR.
    I found out that every 3D gameObjects created in the scene (except children of AR Camera) are tracked as AR objects and do not move along with the camera viewport
    What I want is to explicitly exclude some objects and make them always fixed on the device's screen.

    What is the best way to do this?
    For now, the only way I could do is to make them children of the AR camera but this is an annoying object structure. I tried another way to write script or to use position/rotation/parent constraint and make the objects follow the AR camera transform but this way makes the objects out of the correct position frequently ( I guess it's due to transforms not sync. in the correct order)
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    956
    This is the best way.
     
    mb13admin likes this.