Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector playerVector = player.getVelocity();
- Vector eyeDirection = player.getLocation().getDirection().setY(0).normalize();
- Double velocityInDirection = playerVector.dot(eyeDirection);
- Vector directionVector = playerVector.subtract(eyeDirection.multiply(velocityInDirection));
- player.setVelocity(directionVector);
Add Comment
Please, Sign In to add comment