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

Android device jump scripte

Discussion in 'Scripting' started by Arzacks, Sep 24, 2017.

  1. Arzacks

    Arzacks

    Joined:
    Dec 23, 2016
    Posts:
    37
    Hi !
    How do i get to modifie the Y axis when i tap the screen, i already have the scripte that captures a tap but after i have to make my caracter jump, help please ? :)

    Thanks !
     
  2. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    Why not look into Rigidbody.AddForce for making the character jump?
     
  3. Arzacks

    Arzacks

    Joined:
    Dec 23, 2016
    Posts:
    37
    Hey, i looked it up, sorry i didn't get it a 100%,
    I forgot to say i'm in 2d so i used "Rigidbody2D.AddForce", if i understood well, it's only for accélerations no ?
    I'm looking for something that will move character,
    Or should i keep looking on the "Rigidbody2D.AddForce" ?
     
  4. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    It will add force to the character, so it will move it.

    If you're new to unity, you should do some tutorials to understand a bit on how it works: https://unity3d.com/learn/tutorials
     
  5. Arzacks

    Arzacks

    Joined:
    Dec 23, 2016
    Posts:
    37
    Okkay, thx :)