Particle pool - problem with reseting position
Hello,
I'm using Sparticles for my rpg game for android/ios and it's working great :) During the development i decided that i have to use particle pool to limit mamory allocations. So i've created object pool where i'm keeping once used particles and i'm reusing them when i have to display it again. It works fine for explosions or some other time limited obejcts.
The problem is when i want to reuse effects like meteor that have a tail that is following main object. When i'm adding it again on the screen then the part of the tail is appearing on the screen in it's previous location. I tried to use ParticleGroupAnimator.resetTime() function but it didn't helped.
My question: how can i reset position of the particles inside a particle group?
I've managed to find a workaround for this: I'm placing those effects under a ground and wait until tail is reaching main object. Then removing it from the screen. But it's not very effective :)
...You must Sign up as a member of Effecthub to view the content.
A PHP Error was encountered
Severity: Notice
Message: Undefined index: HTTP_ACCEPT_LANGUAGE
Filename: helpers/time_helper.php
Line Number: 22
Latest Posts
Sponsor
They are waiting for your help
- DirectX vs OpenGL on Windows
- Betting combines excitement and strategy, offering a unique way to engage with sports and events. When approached responsibly, it transforms into a rewarding and enjoyable experience!
- looking for a map editor
- Package flash game to AIR mobile (IPA)
- How to restart a standalone Adobe Air/Flex application
2531 views 2 comments
You must Sign up as a member of Effecthub to join the conversation.
A PHP Error was encountered
Severity: Notice
Message: Undefined index: HTTP_ACCEPT_LANGUAGE
Filename: helpers/time_helper.php
Line Number: 22
Thank you so much for the replay. It's working great now.
A PHP Error was encountered
Severity: Notice
Message: Undefined index: HTTP_ACCEPT_LANGUAGE
Filename: helpers/time_helper.php
Line Number: 22
Hello
You can set subMesh.animatorSubGeometry.previousTime to Number.NEGATIVE_INFINITY:
for each (var subMesh:SubMesh in mesh.subMeshes)
{
if(subMesh.animatorSubGeometry)
subMesh.animatorSubGeometry.previousTime = Number.NEGATIVE_INFINITY;
}