Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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.