Help with leap (velocity)

Discussion in 'Plugin Development' started by Pr07o7yp3, Sep 4, 2014.

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

    Pr07o7yp3

    Ok, I'm very bad with these vectors.
    I'm trying to make leap function.

    I want to push player highly (Y + 10) and then push him back to the ground with high speed.
    Is this possible?
     
  2. Offline

    gamerover98

    test this:
    Code:
    p.setVelocity(p.getLocation().getDirection().multiply(1.5).setY(10));
     
  3. Offline

    mythbusterma

    gamerover98

    Why not just:

    Code:
    Player ply;
     
    ply.setVelocity(ply.getVelocity().add(0,10,0);
    
    Then schedule a task to launch them back down after the apex of their jump.
     
  4. Offline

    Pr07o7yp3

    This push backward.
     
  5. Offline

    Jimfutsu

    This is because of Java math, you if @mythbustermapushes them backwards, the set the .add(0, 10, 0) to .add(0, -10, o)
     
  6. Offline

    Zarkopafilis

    Make 2 schedulers. (You know , delay stuff)
    Push him up with a 0, Y , 0 vector in the first timer, push him down with an 0 , -3Y , 0 vector.
     
Thread Status:
Not open for further replies.

Share This Page