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

How to make jump like geometry dash

Discussion in '2D' started by makkik, Dec 23, 2021.

Thread Status:
Not open for further replies.
  1. makkik

    makkik

    Joined:
    Jun 1, 2021
    Posts:
    4
    So i have the basic jump completed on my game, i use rigidbody2d but i wan't the player rotate everytime it jumps like in gemetry dash, how can i do that in unity 2d?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,710
    Does the rotation matter to gameplay (eg, does the angular moment matter if the player contacts something while spining?)? If so, rotate the Rigidbody2D through the loop, or set it spinning (rigidbody.angularVelocity) and stop it.

    If the rotation doesn't matter to gameplay, just make an animation of the rotation and play it.
     
  3. makkik

    makkik

    Joined:
    Jun 1, 2021
    Posts:
    4
    could you maybe teach me how to do the angular velocity?
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,710
    The short answer is:

    Code (csharp):
    1. rigidbody.angularVelocity = 10;
    If 10 doesn't work, try 100, if that doesn't work, check constraints.

    When the desired loop is finished, set it back to zero

    The practical answer is, play with it, try some values, see how it works, maybe even try tutorials for the kind of motion you want, such as these:

    Screen Shot 2021-12-24 at 10.24.42 AM.png
     
  5. tranduydyu98

    tranduydyu98

    Joined:
    Dec 30, 2021
    Posts:
    2
    Last edited: Dec 31, 2021
Thread Status:
Not open for further replies.