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

    ZodiacTheories

    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:
    Code:java
    1. a.setVelocity(p.getLocation().getDirection().add(new Vector(5, 0, 0)));


    If anyone could help me it would be great :)

    Thanks

    Never mind, solved!

    Solved like this:

    Code:java
    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. 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

    ZodiacTheories

Thread Status:
Not open for further replies.

Share This Page