I continued with my conversion of my Enemy class to an abstract class to start using overriding classes following the great Blog Austin wrote:

This involved creating a new abstract base class from the original class, converting all the methods to virtual , changing variables to protected, then creating a new inherited class script that was unchanged, and putting that on the original enemies and setting it up, so that the new abstract class would function like the original to start with. Unfortunately I was seeing a huge number of issues and very strange behavior with this initial test.

These errors were things like:

  1. Errors seems to clearly be occurring, yet logging not error in the console.
  2. Errors were being reported in scripts what were disabled and should not run

I carefully went through trying to debug this to no avail. I finally asked Austin for some help, and after reproducing some of the bizarre behavior and trying to fix it, we ended up just closing and restarting Visual Studio and Unity, and this fixed everything. Somehow Unity had gotten corrupted, while frustrating, at least it explained the unusual results and I was back on my way.

In addition what further complicated things — I was using a technique of putting the new abstract class inherited script on the same object with the original Enemy script, and then disabling/re-enabling each to test back and forth. This is a no-no, I had encountered some peculiarities with this in the past and should not have tried this. The reason is that Unity compiles and makes available methods in scripts even when they are disabled in the inspector. This is likely why I was getting unexpected errors referenced in scripts I had disabled. I didn’t want to remove the old script from the inspector because it had serialized field entries that had been tested to work, and didn’t want to bother with setting that up again each time I wanted to test back and forth.

Kind of funny that with my code bug invasion, for some reason the real physical bugs were in my house and flying around my computer like never before — a huge wasp and big black flying ants. Probably from the rain. LOL!

We onboarded 25 new students this Monday, what a whirlwind of activity for us all. We created 6 new teams. Also some scrambling to make sure everyone had submitted documentation to continue with the course.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store