issues
search
antfarmar
/
Unity-3D-Asteroids
A simple Asteroids clone. In 3D.
The Unlicense
65
stars
15
forks
source link
Bugfix for bullets randomly disappearing prematurely
#30
Closed
antfarmar
closed
8 years ago
antfarmar
commented
8 years ago
This was how it was fixed in the earlier design.
Invoke continues to execute even in a disabled script. It needs to be cancelled.
The pool is a LIFO stack implementation
The pool ends up using bullets whose Invoke has yet to execute (if it hit an asteroid and was pooled early, before the bullet's lifetime expiry)
Hence, they were pooled again prematurely due to the outstanding Invoke.
This was how it was fixed in the earlier design.