- Home /
Particle system rotation/spread not working
Below is the prefab for the particle system for a bullet hit in my game. You can see that the particle spread is about 30 degrees
However, when a bullet hit is actually seen in game, it looks like you see below at the top of the screen, with the particles spreading out in all directions Here is the code I used on the wall collider to instantiate the particle system:
private void OnCollisionEnter2D(Collision2D collision)
{
if (!collision.gameObject.CompareTag("Bullet"))
{
return;
}
ContactPoint2D contact = collision.GetContact(0);
Quaternion rot = Quaternion.FromToRotation(Vector3.up, contact.normal);
Vector3 pos = contact.point;
Instantiate(bulletHit, pos, rot);
Destroy(collision.gameObject);
}
I just started Unity and have been trying to solve this issue for an hour to no avail. Thank you for any responses!
Answer by Tyler32123 · Jul 12, 2020 at 03:39 PM
I figured it out !!!!!!!!!!!!! So the problem was that it was a cone, but looked like a sphere because the cone was facing out into the 3rd dimension. The solution is just to instantiate it with an x rotation of -90 so that it is actually facing the right way for 2 dimensions.
Your answer
Follow this Question
Related Questions
Multiple Particle Systems Performance 1 Answer
Flip Particle System Graph 0 Answers
Why does the Particle System restart when I unparent? 1 Answer
How to make fixed particle system scale? 0 Answers
Particle System Emission Rate Scriptt 0 Answers