identify where the player is looking

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Scopel_Yan

Member
Jul 16, 2024
1
0
1
I want to identify where the player is looking so that whenever I summon particles they are in front of the player
Code:
command /energyball:
    trigger:
        set {_location} to the head location of player
        set {_x} to x-coordinate of {_location}
        set {_y} to y-coordinate of {_location}
        set {_z} to z-coordinate of {_location}

        loop 100 times:
            execute console command "/particle dragonbreath %{_x} - 2% %{_y}% %{_z}% 0.5 0.5 0.5 0 100 force"
        wait 2 tick

here I had a good result, but without the subtraction in the x coordinate the particles are on top of the player and I want them to be at a certain distance from the player, but always in front, with the subtraction of the x coordinate the particles are behind the player when I move my head to the east
 
I want to identify where the player is looking so that whenever I summon particles they are in front of the player
Code:
command /energyball:
    trigger:
        set {_location} to the head location of player
        set {_x} to x-coordinate of {_location}
        set {_y} to y-coordinate of {_location}
        set {_z} to z-coordinate of {_location}

        loop 100 times:
            execute console command "/particle dragonbreath %{_x} - 2% %{_y}% %{_z}% 0.5 0.5 0.5 0 100 force"
        wait 2 tick

here I had a good result, but without the subtraction in the x coordinate the particles are on top of the player and I want them to be at a certain distance from the player, but always in front, with the subtraction of the x coordinate the particles are behind the player when I move my head to the east
Not sure if this is too helpful, but you could maybe get the player's selected block (Here) and use that coordinate to adjust the particles to be right in front of the player.