Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Follow orientation, no longer available?

Discussion in 'AR/VR (XR) Discussion' started by Pulov, Jan 14, 2015.

  1. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Hi there,

    Back in 0.4.2 there where more params to tweak in the inspector than there are in 0.4.4 WT*. There was a pretty handy one that did allow to follow orientation witch was handy with stuff mounted on a car or any kind of vehicle.

    It seems no longer available right?
     
  2. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,076
    I noticed that too. It does however appear now to default to follow view on the object it's attached to. My boat sim with the onboard camera works the same in the version without the follow option as it did in the version with the option. Maybe somebody who knows more about it can explain the details.
     
  3. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,076
    In other words, it appears to "follow view" automatically and lock to the object the camera rig is attached to rather than having to drag an object into a follow view slot.

    If you need to change it you could just use Transform.parent, probably.
     
  4. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Thanks!. You're right.
     
  5. Woppercyb

    Woppercyb

    Joined:
    Feb 2, 2015
    Posts:
    3
    Please, Pulov, Can you paste your code to follow a car when the player wants to change into foot and use the car? I tried to do the instructions of a tutorial of the unity but NOT work with Oculus, so, with OVRPlayerController and OVRCameraRig (SDK 0.4.4)?

    I don't find this information anywhere :-(((

    Thank you very much in advance

    Grettings
     
  6. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    I did not modify the unity integration package from oculus.
    You could try to make the camera a child of the vehicle when it enters the card, doing so should follow the car orientation.

    Or whe entering the car, make an script that binds the transform rotation of the car to teh camera rig rotation.
     
  7. Woppercyb

    Woppercyb

    Joined:
    Feb 2, 2015
    Posts:
    3
    Thanks for you answer. I forgot to say that I am newbie with Unity3D.

    I tried this in my C# Script:

    public GameObject OVRCameraRig_Principal;

    OVRCameraRig_Principal = GameObject.Find ("OVRCameraRig_Principal");

    OVRCameraRig_Principal.parent = swlandspeederobj.transform; --> This not work, Unity says: GameObject does not contain a definition for parent.

    I tried use: Object, OVRCameraRig and does not work

    Can you help me, please ?

    Thanks a lot in advance.

    Grettings
     
  8. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
  9. Woppercyb

    Woppercyb

    Joined:
    Feb 2, 2015
    Posts:
    3
    Hello,

    Thank you very much but I had already read that article. The camera goes shoots back, like a rocket.

    I will continue investigating. Thank you very much for your help.