Some things came up preventing me from working on the project for a couple of days, but I was able to get my base AI, health and death working (mostly).
I've noticed a few unwanted behaviours caused by Unity's physics engine and my projectiles where they'll sometimes hit an enemy and ricochet in strange ways instead of just disappearing like they're supposed to. I leave fixing that for clean up after I've implemented the rest of my features.
But I've gotten a simple AI that all (or most) of my enemies will inherit. They basically just move within a certain range of the player and continue to attack until he's out of range, at which point they begin to move again.
I've tested the behaviour with a large group of enemies, and it all seems fine. The enemies overlap one another, and visually I don't much care for this, but I'm not sure there's any way around it if I want to allow multiple enemies to attack the player at the same time (which I do). Maybe I'll add a semi-random hue to the enemies' sprites when they're spawned just to spice up how it looks a bit.
The player spawns indication text similar to that shown in my last post when he's taken damage. He also actually takes the damage and dies (destroys his own gameObject for now) when his health drops below 0.
Haven't had the time to code the UI to display health correctly yet, but that should only take five minutes (I probably just jinxed myself...)
Anyway, it's coming along. I think this journal thing might be helping a bit.
Hopefully tonight I can get the health bar working. After that it's spawning cash pickups on enemy death with a chance of ammo or health pickups being dropped.
Once those things are finished (hopefully one development session), I'll work on the motor bike repair. After that's done, the core gameplay mechanics will be in place and all that's left to do is add the levelling/upgrade functionality (I think the design will take longer than the implementation on this one), add different enemies and create the rest of the graphics.
If I'm lucky/diligent, hopefully I'll be done this bad boy by the end of February.
For Unity and physics, it's kind of a battle. Have you already messed with the interpolation types? Extrapolate or Interpolate might help. You might also want to up the solver iteration count on the projectiles. And I've found that with things like OnTriggerEnter, it just sometimes doesn't fire reliably, to the point where every place I have OnTriggerEnter, I also have OnTriggerStay, and duplicate the logic there.
Ex: OnTriggerEnter() { KillProjectile(); } OnTriggerStay { KillProjectile(); }
Finally, you can update the rate at which physics gets updated, though that can have major performance impacts.
EDIT: And failing that, if you're shooting a fast enough projectile, you might be better off just doing a ray or sphere cast.