Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

I'm slowly losing my mind.... empty child gameobject inheriting parent aircraft physics....

Discussion in 'AR/VR (XR) Discussion' started by Dingledorf, Dec 7, 2018.

  1. Dingledorf

    Dingledorf

    Joined:
    Nov 24, 2012
    Posts:
    16
    Hello,

    Please help, I have an airplane full exterior and full interior cockpit modeled and with full aircraft physics.
    I have setup controls that are fully controllable with VR hands, no input device needed.
    Here is my issue. I need the cockpit interior model to not be effected by the parent aircraft physics/forces at all.

    I thought that if I place the cockpit outside of the aircrafts hierarchy and instead place and empty gameobject where the cockpit should be (inside the hierarchy), I can just reference that empty gameobject's transform position and that would be it.However it doesn't work, I mean it does work, it places the cockpit inside the aircraft which is great, but the cockpit model is still effected by the aircraft physics which basically makes controlling the flight stick and throttle with VR hands very difficult because multiple forces are being applied.

    What am I doing wrong?

    Here is an example of the script:

    public class CockpitGhostScript : MonoBehaviour {

    public GameObject myFirstObjectReference;
    public GameObject mySecondObjectReference;


    // Use this for initialization
    void Start () {

    myFirstObjectReference = GameObject.Find("Outside_Cockpit");
    mySecondObjectReference = GameObject.Find("Inside_Cockpit");

    }

    // Replace empty transform with cockpit model
    void Update () {

    myFirstObjectReference.transform.position = mySecondObjectReference.transform.position;

    }
    }
     
    Last edited: Dec 7, 2018
  2. Dingledorf

    Dingledorf

    Joined:
    Nov 24, 2012
    Posts:
    16
    Fixed! I removed OVR rig and Cockpit from the Aircraft and used position/rotation constraints to stop any unwanted forces.