It feels like Unityās 2D animation control is quite good. I donāt have a lot of experience with other tools, mind you; Unreal didnāt have a native 2D mode back when I started this, Iād messed around with GameMaker having bought it in a Steam sale, and had actually worked on some animation and tile engine stuff in XNA, right before Microsoft announced it was no longer supporting XNA - but Unity was popular, had native 2D, and as far as programming goes, .NET is just nice.
So todayās fragment was spent developing my half-done character animation system. Iām basically binding player movement to directional run and idle animations. So using WSAD the player runs up down left right (or north south east west) and when they release WSAD, they stop running and stand idle facing the last run direction.
Pretty simple except I got my state flow wrong the first time around and am now fixing it.
Iām also having some trouble with the best way to run to the diagonal points, from a coding perspective. Using Unityās Input.GetKey works for one key, but not so well for multiple keys, so I need to find a way around that.
Thereās also the issue that state transitions donāt seem to work, and Iām pretty sure these are exclusive to the idle animations transitioning to run animations. See from any state, itās possible to specify that the animation doesnāt have to complete, e.g. if I press and release D, itāll start the run east animation, but if itāls only played two frames of the eight in the animation loop, itāll will stop the animation.
But since Iām not defining any transition from idle to anything else, I donāt seem to have the option to do this, and the animation continues playing to the end; so if I release D then quickly press S, the character moves south, but is stuck in the east idle animation doing so.
The solution might be in code rather than GUI, and it might take some investigation to solve this particular issue.
In the meantime, I have a player character animated, running from any state!