Unity Packages

So I was inspired to actually go deeper in Unity by their announcement that they were making Unity Learn Premium free – from March to June 2020.

As I started watching and learning from Unity experts, I realized one of the big gaps I hadn’t even known about was that Unity had a package management system.

I checked my editor and for some reason I was missing packages entirely.

I did some digging, and it turns out in my infinite wisdom that I had installed one of the Long Term Support packages that Unity offered … in 2017.

It turns out that the build was published before they had invented this, and the LTS clients don’t inform you about updates by their very design.

So, after upgrading to the bleeding edge Unity (and they update monthly) I started experimenting, and I highly recommend:

Memory Profiler.
TextMesh Pro.
2d Animation.

I know this sounds trivial, but I spent more than a few hours puzzling this one out!

Animator VS Animation

I am still reading more about the evolution of this, because my current workflow doesn’t match an ideal UX:

  1. Create animator component.
  2. Manually create animator controller (right click project area.)
  3. Select the animator controller in the component.
  4. I generally layout my states in the controller.
  5. I then go to the animation tab, add clips (which add new states that I remove in the animator controller.)
  6. I then assign the motions to the states I want.

It seems like historically you could only use the Animation tab to record things and then apply that motion directly instead of with the state machines that the Animator tab gives you.

So I am going to try and not layout my states ahead of time and just record the clips.

I think the exit time/UI is also super confusing, I am going to need to read more about how that works, most of the time I am just migrating the boxes that represent the animation lengths off of each other by fiddling with the various knobs.

Anchors and Pivots

Upon first working with the anchors and pivots system in unity I got confused, things didn’t end up where I wanted them, and I didn’t understand what the UI was trying to tell me.

I made a simplified example to show some things that I didn’t immediately catch onto.

Anchors allow you to not only define how the UI change as screens resize (and this is super important), but they also change the relative position of the element from its anchor, and that’s how its position is defined.

In the pictures above the only thing I changed was the Rect Transform’s anchors (click the square picture that demonstrates its current position and you can select this, this was not obvious to me at all.

Also this may not be obvious to you yet, but nested objects automatically scale and transform based on the parent, so nesting panels is the way to go (similar to nested divs/spans in a web context.)