Particle location at 30fps incorrect

I was trying to do some testing of my game at a lower FPS, and I noticed something odd: when a particle system’s parent is a rigidbody and the game is running at 30fps or lower, when particle effects are played they lag far behind the ridigbody.

For example, the player is moving to the right and dies, the Play function is called on the particle effect that is parented to the player’s rigidbody. The explosion will appear significantly behind the player when the game is running at 30fps. When the FPS hits above 35 or so, it’s fine again. And this happens whether I turn vsync off and use Application.targetFrameRate or turn vsync on every second frame.

I’ve uploaded a test project that demonstrates this. Attached to the cube, you can limit the frame rate or go into the quality settings and set the vsync setting to every other frame. I’ve also done some testing and general futzing around, like logging the exact position of the rigidbody and particle system object (they were the same) and shut off various subsystems of the particle system (nothing seems to help).

Yeah, this is definitely looking like a Unity bug. Select the “Prewarm” option under the Particle System to correct the behavior. It is rather odd though as the particles are released well before x=6 in your scene. I even put a breakpoint in when you start playing the particles, and the box is at x=6 while the particles come out at x=-1’ish.

So even if it was a warmup/timing issue, there’s really no reason for the particles to start before you reach the x = 6 point. It’s almost like it takes a while for the engine to create the particles, and then it moves them backward in time instead of forward, so they may have a negative sign issue in the engine when compensating for the time between kicking the particles off and how long it takes them to be created. I would report it as a bug to Unity just to be safe, and this is a nice little test project to send them. I had the issue at all frame rates.