Solved circles can not get directional!

Discussion in 'Spigot Plugin Development' started by magas8, May 22, 2017.

Thread Status:
Not open for further replies.
  1. Hello again guys i try to make the directional circles but ..... i failed here is my code can anyone help me i want to make circles in the direction that a player is looking
    new BukkitRunnable() {
    Location loc = player.getLocation();
    double t = 0;
    double r = 0;
    Vector direction = loc.getDirection().normalize();



    @Override
    public void run() {
    for (int degree = 0; degree < 360; degree++) {
    t= t+1;
    double radians = Math.toRadians(degree);
    double x = loc.getDirection().getX()*Math.cos(radians);
    double y = loc.getDirection().getZ()*Math.sin(radians)+1;
    loc.add(x,y,0);
    player.getWorld().spawnParticle(Particle.FLAME, loc, 1, 0, 0, 0, 0);
    loc.subtract(x,y,0);
    }
     

    Attached Files:

    #1 magas8, May 22, 2017
    Last edited: Jul 3, 2020
  2. Try something with double z = Math.sin(radians);
     
  3. same problem ............... z axis didnt help
     
  4. mathhulk

    mathhulk Retired Moderator
    Retired

    This is not a resource. Please do not use the resource tag incorrectly.
     
Thread Status:
Not open for further replies.