Create a ray and check if a player was in the ray

Discussion in 'Plugin Development' started by ScopeTowel, Mar 27, 2020.

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

    ScopeTowel

    Hello everyone, today I have an important dilemma, in fact I have to create a laser game and I would like that when a player makes right click in a direction a light beam like orange particles go in the direction during 10 block , and I would like to know if a player finds it in this direction. Can explain to me first how create this famous ray and then how to detect if there is a player in this ray
     
  2. Offline

    CraftCreeper6

    @ScopeTowel
    I don't know how you would do this nicely. One way I can think of is shooting an arrow (or snowball) at a very high velocity and checking for a player hit. If a player was hit, then that player is in the beam.
     
  3. Offline

    ScopeTowel

    I will try that
     
Thread Status:
Not open for further replies.

Share This Page