1
votes

I have a gameObject which is rotating around one point, and attached particle system (attached to child node) to it, and when I change direction of rotation (gameObject is moving opposite direction), my particle system doesn't flip with my gameObject and continue going on top (it should be on the bottom).

So I've spent much time on it, and maybe you have know some ways to fix that. Hope screens will make it more clear.

1st direction:

1

2nd direction:

2

2

2 Answers

0
votes

You can fix this in 2 ways:

  1. flip the character by changing y rotation to -180 and then to 0 instead of doing it with other methods or animation. In this way the child object will move too and it will work.

  2. change the render mode of the partcyle system to world space and see if it's moving. Or if you are changing the flip with the animation you can record the animation so you change the position of the particle system manually. In this way then you are going to flip the particle is going to flip for the animation

0
votes
public void changeDirection()
{
    flipShip();
    vec = new Vector3(0, 0, -vec.z);

    var rotationVector = new Vector3(transform.rotation.x, transform.rotation.y, 
    180+transform.rotation.z);

    transform.rotation = Quaternion.Euler(rotationVector);
}