Search Unity

  1. Unity 2018.3 is now released.
    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've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Is there a way to make two rigidbody2D's act like one is parented to the other?

Discussion in 'Physics' started by Afropenguinn, May 10, 2018.

  1. Afropenguinn


    May 15, 2013
    So basically, I want one rigidbody to rotate and move with respect to the other, but still be free to move around itself. My use case is that I want a space ship that you can enter and travel in from a top down perspective. While outside the ship, you'll be in a dragless environment (being top down, the gravity is essentially determined by drag), but while in the ship it should feel like the ship is stationary, even while it's in motion. I could accomplish this by making the ship's interior a separate "room" that's stationary, but I wanted to at least attempt a seamless transition.

    So far I've tried various joints, having the most luck with the friction joint, with the downside being that the rigidbody in the ship now affects the ship's rigidbody. I'm pretty new to using the physics engine, so any help would be much appreciated!
  2. knobblez


    Nov 26, 2017
    it sounds like you have to do this though script mostly.

    if one GO moves out of the radius of the leading GO it will receive force(like a nudge) towards the center of the leading GO.
    i dont think you could accomplish the flowy effect by parenting it because they are locked together.

    is this world super huge? if youre worried about gravity drag changes it must be a large ship inside a very large map...sounds like it anyway.

    you might want to reduce drag onColliderEnter(entering the spaceship)
    and add drag onColliderExit(exiting the spaceship). that should give you a nice effect if you adjust the drag correctly.

    im a noob