Solved Make an arrow go straight?

Discussion in 'Plugin Development' started by ZodiacTheories, Aug 14, 2014.

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


    Hi, I am making a plugin, and I am trying to do it so that when a player shoots an arrow, it goes straight. I am really bad at Vectors :p

    I tried doing it in the players direction and then adding a bit but that made the arrow go far off the desired location.

    I tried this:
    1. a.setVelocity(p.getLocation().getDirection().add(new Vector(5, 0, 0)));

    If anyone could help me it would be great :)


    Never mind, solved!

    Solved like this:

    1. arrow.setVelocity(player.getLocation().getDirection().multiply(4));

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 9, 2016
  2. Offline


    ZodiacTheories I wonder what this was for! Also, shame on you for solving something and not sharing for others benefit :p
    ZodiacTheories likes this.
  3. Offline


Thread Status:
Not open for further replies.

Share This Page