1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Particle

Discussion in 'Development' started by Shockskill, Mar 5, 2017.

  1. Shockskill

    Shockskill Silverfish

    Messages:
    15
    GitHub:
    Shockskill
    I have add particle to a player but
    when i turn to the right side the particle
    are there look at picture


    but i will that the particle always are on the
    back side
     

    Attached Files:

  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Where's the code?!
     
    InspectorGadget likes this.
  3. Shockskill

    Shockskill Silverfish

    Messages:
    15
    GitHub:
    Shockskill
    Here
    PHP:
     $x $player->getX();
        
    $y $player->getY();
        
    $z $player->getZ();
        
    $level $player->getLevel();  
          
    $v4 = new Vector3($x 0.5,$y 1,$z);//Vorne
          
    $v5 = new Vector3($x 0.5,$y 1.1,$z 0.2);
          
    $v6 = new Vector3($x 0.5,$y 1.2,$z 0.3);
          
    $v7 = new Vector3($x 0.5,$y 1.3,$z 0.4);
          
    $v8 = new Vector3($x 0.5,$y 1.4,$z 0.5);
           
    $v9 = new Vector3($x 0.5,$y 1.5,$z 0.5);
           
    $v10 = new Vector3($x 0.5,$y 1.6,$z 0.5);
           
    $v11 = new Vector3($x 0.5,$y 1.7,$z 0.5);
           
    $v12 = new Vector3($x 0.5,$y 1.8,$z 0.5);     
          
    $v13 = new Vector3($x,$y 2,$z 0.5);
          
    $v14 = new Vector3($x,$y 2,$z 0.5);
          
    $level->addParticle(new FlameParticle($v4));
          
    $level->addParticle(new FlameParticle($v5));
          
    $level->addParticle(new FlameParticle ($v6));
          
    $level->addParticle(new FlameParticle($v7));
          
    $level->addParticle(new FlameParticle($v8));
          
    $level->addParticle(new FlameParticle($v9));
          
    $level->addParticle(new FlameParticle($v10));
          
    $level->addParticle(new FlameParticle($v11));
     
  4. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Make sure that you add if statements that check the direction that the player is facing
    PHP:
    if($player->getYAW() == (int) $direction) {
        
    $v = new Vector($x$y$z);
    }
    $level->addParticle($v);
     
    Shockskill and hoyinm14mc like this.
  5. Shockskill

    Shockskill Silverfish

    Messages:
    15
    GitHub:
    Shockskill
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.