Using cos, sin, and for, make 10 particles in a straight line in the direction that the player looks at. Because I want some code example.
you could do something like PHP: for($i=0;$i < 10;$i++)$level->addParticle(new PARTICLE($player->add(0,1.62)->add($player->getDirectionVector()->multiply($i))));//PARTICLE is whatever particle class you want to use
Try devise some code by yourself for that. It isn't that hard to do it as it seems... You won't take anything from it if I put the finished code here.
I'm not sure this will work, if don't try add PI/2 or 3PI/2 in function's arguments PHP: $lenght = 20;for($i = 0; $i < $lenght; $i++) { $x = $i * cos(deg2rad($player->getYaw())); $z = $i * sin(deg2rad($player->getYaw())); $y = $player->getY() + 1;}
just getYaw() is left, isn't it? or is getYaw() get's player's looking side? I can't try code now so can you tell me