Bullets Muse
Today was the day I finally crushed the problem of the weapons not shooting like normal. For two days I wrestled with the problem of rewriting the weapon code so that the bullet, zoid, weapon all remained as separate entities so that I could mix and match them later on for easy user customization.
I converted two scripts, including the code in my previous post, Player_Zoid_Control, and bullet_control into three other scripts, Weapon_Handle, Bullet_Handle, Bullet_Mech, so that the zoid, weapon, bullet respectively can do their own stuff, just exchanging state messages to communicate. It sounded great to me, except it won’t shoot.
I logged the OnRayHit event and found the bullet hitting the floor most of the time. Other times it shot itself in the foot. Sometimes it flew to who knew where and all I could see was a fleck of dust off the screen. What the heck?
I used the following code...