Guest User

Untitled

a guest
Oct 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. Vector playerVector = player.getVelocity();
  2. Vector eyeDirection = player.getLocation().getDirection().setY(0).normalize();
  3. Double velocityInDirection = playerVector.dot(eyeDirection);
  4. Vector directionVector = playerVector.subtract(eyeDirection.multiply(velocityInDirection));
  5. player.setVelocity(directionVector);
Add Comment
Please, Sign In to add comment