My end of section notes: details, details, details

I’ve been away from my Unity projects for a couple of years now, because my tools stopped working. (I’d been developing in Windows, but under a VM, and MS broke that VM in the Fall/Winter of '18). Life being life, I’ve been otherwise occupied since then. So, while I’ve been through this section before (twice, actually) I decided to skim through as a refresher.

First: Unity has a way of tricking me. Often, I bang my head against it for a while, and sometimes I even watch your video, see you do something, then try to repeat it… and find that I’m still banging my head against a wall… In this section Unity got me with the process of assigning the scripts and buttons. I was trying to drop the script from my Assets panel into the inspector, and I was not finding my method(s).

Obviously, this is because the object I need assigned is the object from the scene that has the script attached. How many times have I made a similar mistake? I have lost track! With luck, this will help to burn-in to my brain: inspector assignments must come from the active scene and not from the Assets panel.

Second: as usual, I was doing the challenge in my own way. I bypassed the trouble with re-guessing a number with the way I implemented my “random guess” method, but my resulting code did have one of those pesky “magic numbers” in it (I was doing a divide by five to limit the range of guesses). Well, before I can move-on, I think I need to change that. My current plan is to have a float from 0-1 that I’ll call ‘dispersion’; with a dispersion of zero, it should go for the most efficient guess (i.e. 500, 250, 375…) but with a dispersion of one it has the chance to do an opening guess as extreme as either 1 or 1000. Just an idea, but it seems like a fun way to wrap it up.

2 Likes

I love this type of journal post. I think more people should post their thoughts like this. Great stuff man!

Privacy & Terms