Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Problem with .AddExplosionForce

Discussion in 'Physics' started by Biscuit_Mama, Jun 12, 2020.

  1. Biscuit_Mama

    Biscuit_Mama

    Joined:
    Feb 16, 2017
    Posts:
    2
    Sooo... I'm trying to code rocket jumping, and I'm having some problems.

    The problem doesn't seem to be in the code itself, because the explosions push objects back. Explosions knock back objects but doesn't launch them upwards from the ground (unless with object rotation not constrained).

    What should I do to get the flying upwards as well? Should I add something to the code or something else?
     
  2. dahiyabunty1

    dahiyabunty1

    Joined:
    Jan 22, 2020
    Posts:
    68
    where is code...

    why not use

    rb.addforce(vector3.up * 100, forcemode.impulse)

    for one time thurst
     
  3. shivanshsaini17

    shivanshsaini17

    Joined:
    Aug 17, 2018
    Posts:
    4
    There is an upward modifier parameter for addexplosionforce. Set it to 3 or 4 something and your objects will explode in upward direction.