Particle System, Texture Sheet Animation and rotarion

Hi everybody,

I’m trying to figure out how to rotate a particle system in the z-axis but I can’t find any post talking about it so I think I’m doing something wrong maybe…

My game is a 2D top-down RPG and I need to play a “hit” effect every time my character does a melee attack. For this, I’m using a particle system with a Texture Sheet Animation and it works very well but since my character can attack in four different directions (up, right, down and left) I would need to rotate the particle system to match this direction but I can’t get it working.

Here’s a gif example of my particle system facing right direction:

Do you know a way to rotate it along the z axis and face the direction of the attack of the character? Is this possible?

Well, rotating particle from code is extremely difficult. Particle.Rotation is very weird and I don’t know how to rotate a single particle towards the target. Instead, you can set your system’s simulation space to local and rotate whole object towards desired direction. You can use transform.LookAt or modify rotation directly.

1 Like