Search Unity

Terranigma 2.5D SNES Style Jumping

Discussion in 'Physics' started by DubaN65, Mar 22, 2018.

  1. DubaN65

    DubaN65

    Joined:
    Mar 22, 2018
    Posts:
    1
    Hey there,

    I've been building a 2.5D SNES Style game, which uses pixelart Sprites an a 3/4 view. As physics i use
    2D-Physics and movement via ridgidbody2D on the X and Y axis.
    Now i tried to implement a jumpsystem in my game, but i don´t really know if it´s possible to jump in 2D, when i use the Y axis for movement. The gravityscale is set to 0, so the character isn´t falling "down".

    I tried to change the gravityscale back to 1, when you hit the spacebar, and then i added a force to the ridgidbody2D of the character. After the jump i set back the gravityscale to 0.
    The result is, that the character is falling a bit down and then stops or he is move up, but never comes back down again.

    My question is, is it possible to make it in 2D or should i convert to 3D and use the X and Z axis for movement and the Y for jumping?

    I´ve added the scripts as attachment.
     

    Attached Files:

  2. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    899
    You can change the direction of the gravity in the Physics2DSettings. It can only be set in the X and Y direction. I'm not sure how your world looks, and if you need to use the Z as well. You might be able to get around these limitations by rotating your world to fit the useful axises.