I'm happy to day that today I redeemed myself from yesterdays failures.

Getting the missing parts


After today's daily pickup [of my child at daycare] I set off to buy the toilet seat, the front brake disc, and the hand guard mounts that I failed to get yesterday. My son only threw up once on the journey as well, that's not bad. Also, he refused to exit the huge plastic car attached to the shopping cart at Bauhaus so we were stuck in the parking lot for a god 10 minutes convincing him that it's much more fun traveling backwards in our real car so he can throw up properly again.

Raycast my bullets please


I also managed to implement a great Raycasting bullet script in Unity3d. My previous bullets, or projectiles, were using rigidbody physics and a collider but even with continuous collisions enabled my fast moving bullets went through obstacles. This is not uncommon in Unity from what I understand which is why I had to switch to Raycasting instead.

Basically, raycasting is when you look ahead a certain distance to see if the bullet will hit anything whereas the rigidbody method just teleports the projectile forward and if the step is large enough to step from one side to the other in once fixed timestep, the bullet will just bypass the object. So - check out the link to the bullet script if you have no knowledge of Raycasting in Unity - it helped me out a great deal.

I did do one modification, however. When a rigidbody is hit, I apply AddForceAtPosition (instead of AddForce) in order to introduce torque on the object hit making them spin nicely:
hit.collider.rigidbody.AddForceAtPosition( transform.forward * 
impactForce,transform.position, ForceMode.Impulse );

Shader to make a shielf / forcefield


I also managed to give my spaceship a nice force field shield using a custom shield shader in Unity. Since my little game is top down view I didn't quite get the nice effect as seen on that page - so for the time being I apply a plasma texture that is animated across my ship and it looks quite nice.

Tomorrow is another day


Well sort of anyway. It's 01:59 AM and I have just queued up what to think about when heading off to bed. I'll use some of my brain's processing power to figure out how to best structure the assets for my little space fighter game. I'm hoping to get a prototype of the game up and running in a couple of weeks. It'll just have one space craft and one weapon - but most importantly - multiplayer must work!