Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    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