Been a little over two months since an update. Here’s some of the highlights.
Last time, I wrote about struggling with the new UI system in Unity. I ended up shelving that work work for a little while to focus on other things. It wasn’t until 2 weeks ago that I started messing with it again because someone else wanted to learn about UI stuff. It’s now up to about 90% of where I want it. It looks much nicer even with no special graphics attached, plus it scales well. Overall, I like how UI elements are treated as GameObjects, and I think the UnityEvent system is pretty handy, but it did seem like a steep learning curve to move beyond the basics.
I also managed to finally get our character to animate a la Hotline Miami, with legs that run in the 8 directions of movement and a torso that rotates towards the mouse. Rotation is something I have come to appreciate more than ever, as I had to try out every possible rotation method there is Unity. But it was worth it to make animations much simpler in the Animator Controller.
While working on Line of Sight for our cop NPCs, I ended up learning a lot about how layers work and layer masks and a bunch of other stuff about collision detection. I’m also pretty sure I cracked the problem I was having on my last project. Essentially, when I used raycasts to detect objects, I was mostly finding the same object that was firing the raycasts, as well as trigger colliders (when I only want physical colliders). The solution is to use raycasts for detection on layers other than the one being fired from. In this case I have Cop NPC, on the characters layer, that has an LOS child object sitting on a different layer telling its parent Cop object whether he sees anything. I’m tempted to implement the solution in the old project, just to see where things go…
I will endeavor to get at least some screen shots or something up here.