Particles at relative direction

  • 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 comminuty!

    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!

Status
Not open for further replies.

PatoFrango

Active Member
Jul 12, 2017
240
14
18
Hi,

How would I spawn particles, for example, at both right and left of the player?
 
Last edited:
code_language.skript:
play critical hit at location 1 west of player
play critical hit at location 1 east of player
 
code_language.skript:
play critical hit at location 1 west of player
play critical hit at location 1 east of player
It kinda works, but it's shooting the particles in a certain direction (the only changes I did to your code was the particle and to spawn the particles relative to the player's head, not to the player's feet, but even in your way happens the same).
 
Last edited:
I thought that might happen, here is a slightly improved version.
(There might be a way better way to do this but I'm not sure)
code_language.skript:
if player is facing north or south:
    play critical hit at location 1 west of player
    play critical hit at location 1 east of player
else if player is facing east or west:
    play critical hit at location 1 south of player
    play critical hit at location 1 north of player

Or maybe its best to spawn the particles relative to the player's yaw.

code_language.skript:
set {_loc1} to (player's yaw - 90)
set {_loc1} to (player's yaw + 90)
play critical hit at {_loc1}
play critical hit at {_loc2}
 
I thought that might happen, here is a slightly improved version.
(There might be a way better way to do this but I'm not sure)
code_language.skript:
if player is facing north or south:
    play critical hit at location 1 west of player
    play critical hit at location 1 east of player
else if player is facing east or west:
    play critical hit at location 1 south of player
    play critical hit at location 1 north of player

Or maybe its best to spawn the particles relative to the player's yaw.

code_language.skript:
set {_loc1} to (player's yaw - 90)
set {_loc1} to (player's yaw + 90)
play critical hit at {_loc1}
play critical hit at {_loc2}
That threw errors. I tried doing

code_language.skript:
if facing of player is north or south:
    play flame at location 1 west of player's head
    play flame at location 1 east of player's head
else if facing of player is east or west:
    play flame at location 1 south of player's head
    play flame at location 1 north of player's head
and no errors popped up, but for some weird reason it keeps pushing the particles to a south-east-ish direction.
 
Try adding more specific directions, Like if the player faces South-East to play it at South-West and North-East.
 
Try adding more specific directions, Like if the player faces South-East to play it at South-West and North-East.
I'm pretty sure that's not the issue here. If the particles are being spawned, then it means the effects are being executed, and what's true is that the particles are being pushed by something.
 
Status
Not open for further replies.