Particle System Query Region HitProperties With Unexpected Behavior?

Part of my code (see attachment ‘main.txt’ for entire code):

Runtime:addEventListener('enterFrame', function() local hits = particleSystem:queryRegion( upperQueryBounds[1], upperQueryBounds[2], upperQueryBounds[3], upperQueryBounds[4], { velocityX = 0, velocityY = 0 } ) end )

What I see:

When I set the velocityX and velocityY to 0, I’m understanding (from the documentation here and here) that the particles’ velocity should not be affected by the queryRegion call.

The documentation describes (first link above):

All of the values potentially applied in the hitProperties table are delta values that will be applied to each particle’s current associated value(s). For example, if you apply a velocityY of -40 to the particles in the region, it does not directly set -40 as the actual y velocity on them, but rather it applies that velocity in delta relation to any existing velocity the particles already have.

But it appears to me that the values I set in velocityX and velocityY are directly setting the particle velocity. So, with my code, I see the particles stop when they hit / are within the region.

Does my screenshot reflect the expected behavior? Or is this a bug?

(I’m running 2017.3184 (2017.12.8) by the way.)

(There is an attached thumbnail that I use for my particle image. It’s colored white so you may not see it below, but hover your mouse around and it’ll show up.)

I’ve not worked with liquidfun, but, it sounds like queryRegion can add or subtract velocity, but not zero it out, so if an object is already in motion, the queryRegion call with 0 values would not change that motion.

Is that your understanding?

Rob

Yes, that’s my understanding, but unfortunately that’s not what I’m seeing.

I’ll need you to put together a small project that demos the problem, complete with main.lua, config.lua and build.settings, put it in a .zip file and use the “Report a bug” link at the top of the page so I can get this looked into.

Rob

(I submitted the bug report with the same name as this forum post without the question mark - I see that it’s ticket #13244439 and currently assigned to Bektur)

Thanks!

Fixed in build 2018.3278

  • ParticleSystem: Added deltaVelocityX/deltaVelocityY properties in Query Region

I’ve not worked with liquidfun, but, it sounds like queryRegion can add or subtract velocity, but not zero it out, so if an object is already in motion, the queryRegion call with 0 values would not change that motion.

Is that your understanding?

Rob

Yes, that’s my understanding, but unfortunately that’s not what I’m seeing.

I’ll need you to put together a small project that demos the problem, complete with main.lua, config.lua and build.settings, put it in a .zip file and use the “Report a bug” link at the top of the page so I can get this looked into.

Rob

(I submitted the bug report with the same name as this forum post without the question mark - I see that it’s ticket #13244439 and currently assigned to Bektur)

Thanks!

Fixed in build 2018.3278

  • ParticleSystem: Added deltaVelocityX/deltaVelocityY properties in Query Region