Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Should I add my GameObjects as children of ARSessionOrigin?

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

  1. AnthonyReddan

    AnthonyReddan

    Joined:
    Feb 27, 2018
    Posts:
    13
    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

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    546
    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:
    13
    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

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    546
    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.