Causing collisions to occur, even when the collider is nowhere near the bullet.
Attached is a mp4 showing the issue (Happy to upload to youtube or something if you'd prefer.) Note the bullets turning red when the collider (attached to the ship sprite) isn't close to them.
An example of a Danmaku's OldPosition and Position the moment it triggers a collision:
OldPosition (271384100000000000000.0, 236805600000000000000.0) Position (300.0, 0.0)
Which is pretty clearly uninitialized data leaking into physics calculations.
I was able to fix this behavior by initializing OldPosition on a Danmaku whenever a Danmaku was created.
I added:
OldPositions[danmaku.Id] = danmaku.position;
in three places in DanmakuPool.cs.
(I'm putting together a pull request.)
Causing collisions to occur, even when the collider is nowhere near the bullet.
Attached is a mp4 showing the issue (Happy to upload to youtube or something if you'd prefer.) Note the bullets turning red when the collider (attached to the ship sprite) isn't close to them.
An example of a Danmaku's OldPosition and Position the moment it triggers a collision: OldPosition (271384100000000000000.0, 236805600000000000000.0) Position (300.0, 0.0)
Which is pretty clearly uninitialized data leaking into physics calculations.
I was able to fix this behavior by initializing OldPosition on a Danmaku whenever a Danmaku was created.
I added: OldPositions[danmaku.Id] = danmaku.position;
in three places in DanmakuPool.cs. (I'm putting together a pull request.)
video.zip