- Home /
Particle collision radius origin is offset to the left. How can I make it centered?
Hi all,
I'm making a 2D top-down shooter in Unity and I'm using particles for bullets instead of GameObjects to try to save on performance cost. I've gotten pretty far in development when I started to notice a quirk of the particle collision system (at least as far as I understand it). Some shots appear to go through enemies, even though the center of the particle passes through them.
Those jellyfish are the enemies. That dark blue circle is a particle bullet (set to a sprite material) that is passing through the bottom jellyfish.
I ruled out collision accuracy issues by making sure all the colliders were dynamic and the collision accuracy settings were at their highest possible value. Because it's a classic top down shooter and the player always shoots directly up, I was able to observe that if a shot like the one above misses the first time, it will continue to miss every time unless the player moves to the right. That's when I realized that the origin of the collision radius is in the top left corner, not in the center.
Here's another screenshot of a bullet that is about to successfully collide:
Unity does have a helpful attribute for particle collisions called "Radius Scale," however, because the origin itself appears to be offset, the radius increases around the top left corner so it's still not helping to assure accuracy. Does anyone know how to change the origin of the particle to fix this issue? Or is this a bug in particle collisions?
Answer by ewagstaff · Jun 19, 2017 at 03:26 PM
Also, here are the particle system settings in case that helps answer questions about the setup (I wish the "Visualize Bounds" checkbox would work, but it does not seem to):
Your answer
Follow this Question
Related Questions
Particle effects won't collide/play properly 0 Answers
How to create 3D particle effect? 1 Answer
How to detect which exact particle element from a particle system hit a collider? 0 Answers
Getting particles from the same system to act differently with different objects? 0 Answers
my partical fade away when the emitter moving fast ? 0 Answers