Search Unity

Question Rendering one object on the top of another object

Discussion in 'AR' started by ThresholDDD, Dec 21, 2021.

  1. ThresholDDD

    ThresholDDD

    Joined:
    Jul 20, 2021
    Posts:
    2
    Hi,
    I want to render two objects and keep one always on the top of another one. I want to realize it in the hololens but now just test in the editor. My setting is like this: vuforia detect marker, and then set object1 and object2 to a relative position with respect to marker. Assign object1 to background layer and object2 to front layer. Add a child camera to Main camera, set main camera render background layer, and child camera is in depth only mode rendering only front layer. (https://answers.unity.com/questions/17841/always-render-a-object-on-top-of-another.html). The result is that I can see the object 2 render on the top of object1, but the position keeps changing and the scale is not right, either.

    attached is my hierarchy and second camera setting. Any suggestions? Thanks a lot!
     

    Attached Files: