Search Unity

Starting Position of User

Discussion in 'AR/VR (XR) Discussion' started by hsamuelslynx, Apr 9, 2015.

  1. hsamuelslynx

    hsamuelslynx

    Joined:
    Apr 9, 2015
    Posts:
    1
    Hi, Everyone.

    This is my first post here. Nice to meet all of you!

    I've only recently started working with Unity and I have a question I'm hoping I can get a little help with. We've built a Cardboard app and have noticed that when the app starts up the user might be facing any direction. This means that what we want them to see right away when the app starts up isn't necessarily what they see.

    Is there a way to ensure that either (1) when the app starts up the user is always looking in the same direction, or (2) if it's not possible to control the direction the user is facing when the app starts maybe we can rotate the user to face the direction we want.

    I've come across a discussion that seems related here:
    http://answers.unity3d.com/questions/425734/which-direction-is-character-is-facing.html

    Any help would be greatly appreciated.

    Thx!
     
  2. SoylentGraham

    SoylentGraham

    Joined:
    Nov 12, 2013
    Posts:
    46
    Seems simple to me unless I'm missing something.
    Lets say you want to always have the "user-gameobject" start out with a rotation of A.
    When the game starts, the user's rotation is B.
    Presumably you're currently doing A = user.rotation every update

    Change this to remove the initial rotation B.
    A = user.rotation - B.