Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    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.