Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Bullet around a planet

Discussion in 'Physics' started by BroncoBilli, Oct 16, 2023.

  1. BroncoBilli

    BroncoBilli

    Joined:
    Oct 8, 2017
    Posts:
    90
    Let's suppose I have a 3D planet, and a ship on it, and i want to fire a bullet that goes whinging around the planet. I can do this manually, but would it be possible by a combination of 'tricks' by putting a rigidbody on the bullet, and adding force to it? But it needs to stay in the same orbit, and it would be nice if the bullet stayed tangential to the planet, but not necessary.

    I was thinking of making a bullet with a RB on it, but adding some kind of IK chain and anchoring it to the center of the planet. Would this be horribly expensive for a hundred or so bullets?

    Ideas?
     
  2. BroncoBilli

    BroncoBilli

    Joined:
    Oct 8, 2017
    Posts:
    90
    well I'll be darned. I tried it and succeeded in less than 5 minutes. I don't know how optimal it is though. I'm wondering if there is a way to do this w/o using a FixedJoint?
     
  3. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,841
    You could use a spring joint to keep a fixed distance between the center of the planet and the bullet. This is simple and should work acceptably well.
     
  4. zulo3d

    zulo3d

    Joined:
    Feb 18, 2023
    Posts:
    757