Search Unity

Should I add my GameObjects as children of ARSessionOrigin?

Discussion in 'AR' started by AnthonyReddan, Feb 1, 2019.

  1. AnthonyReddan

    AnthonyReddan

    Joined:
    Feb 27, 2018
    Posts:
    39
    I understand ARSessionOrigin is used to convert trackables from "device" or "session" space into Unity World Space (?), but to be clear it should ONLY be used for this purpose right? I shouldn't place GameObjects (e.g. a ball with a rigid body) in here?
     
  2. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    That is generally correct, yes. But there are valid use cases where it is appropriate to put something under the ARSessionOrigin yourself. See my response to a previous question on this.
     
  3. AnthonyReddan

    AnthonyReddan

    Joined:
    Feb 27, 2018
    Posts:
    39
    Thanks! Presumably that will apply to objects I want to 'anchor' via ReferencePoints as well? e.g. I'd create a ReferencePoint and attach my object to that?
     
  4. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Not necessarily; again it depends on your use case. Making your object a child of the reference point would cause its pose to update automatically, which is usually what you want from a reference point. However, anything under the session origin will not appear to be affected by scale. This is because the camera is scaled by the same amount, so objects under the session origin would not appear to change their size. If you aren't messing scale, then this isn't relevant; just something to be aware of.