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. Dismiss Notice

Resolved How to do a blast against the ground, sending a character flying

Discussion in 'Physics' started by Crazybrownie204, Nov 11, 2021.

  1. Crazybrownie204

    Crazybrownie204

    Joined:
    Mar 22, 2021
    Posts:
    23
    So, I am just wondering, would it be possible (in 3d) to have a character press a button, send something checking whether the ground is close enough, and if it is send something back sending the character flying at the opposite direction that it hit the ground? If anyone knows a way to theoretically do this, please tell me.
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,529
    Of course it's possible because you're just asking, "can you perform a query to detect something" and "can you apply a force to move in a specific direction". I get a sense that you're instead asking if someone could write some code for you instead.

    I would suggest if you don't know how to perform queries then go search for one of the many tutorials on the subject. Applying a force to a Rigidbody is a super basic thing too so if you feel you need it, go look-up a tutorial on that too. Combining the two things is then simple.
     
  3. Crazybrownie204

    Crazybrownie204

    Joined:
    Mar 22, 2021
    Posts:
    23
    Thank you, that is very helpful for directing me in the right direction.