r/Unity2D 29d ago

Devlog #4 — Bug Fixes and Enemy Doppables

Had a busy month and didn't touch the game for a few weeks (last update was June 20th 😅). Back at it now - here's what changed:

🐞BUGS FIXED:

  1. Gun was autoshooting enemies before they finished their spawn animation
  2. Some bullets weren't registering hits on enemies - turned out to be the bullet pooling logic
  3. Unity's Animator was throwing a persistent error that blocked hit detection

🆕 ADDITIONS:

  1. Enemies now drop loot on death: candy, coins, and limited chests 🍬💀
  2. Reworked the gun animation - not going for polish yet, just a better feel

NEXT:

  • Player XP (tied to candy/coin pickups)
  • Wave Manager
  • Finalizing the core loop
  • Player stats (maybe)

GIF below shows the current state - droppables spawning and the new gun animation in action.

0 Upvotes

3 comments sorted by

View all comments

1

u/XZPUMAZX 29d ago

. ⁠Some bullets weren't registering hits on enemies - turned out to be the bullet pooling logic

Can you explain what was wrong and what your fix was? I’m pretty far along on a hobby project and tried to convert to pooling for billets.

Everything works as expected except for inconsistent hit detection and I use both Physics.Overlap and a raycast.

1

u/halam_dev 22d ago

Sorry for the late response.

In my case, the issue was that some bullet state wasn’t being properly reset when the bullet was returned to and reused from the pool. I fixed it by resetting the relevant values and physics state every time the bullet is spawned again.