Week 4 Day 1 - Animation
We did like three different ways of doing animations today.
1) On event tick, you can simply have an object move towards a location. I created some terminator boxes that do nothing but move towards the player and blow up when they touch the player (or get shot). A slightly better way of doing this is to combine it with a traceline so they don't fly straight through blocking terrain.
2) You can set an animation to play on loop on a skeletal mesh. This looks somewhat terrible, but better than an AI just sliding towards you on motionless feet.
3) You can use an animation blueprint, which controls which animation to play based on things like speed, direction relative to motion, if they're jumping, and so forth. The Paragon assets have complex animation blueprints that you can study.
The basics of animating skeletal meshes is this:
1) You have a skeleton, which is just a set of relationships for bones, showing how they connect to each other. If you move your upper arm, your lower arm will move the same way, for example. But if you move your lower arm, it doesn't move your upper arm. So your lower arm is a child of the upper arm. Skeletons are usually held in common across all humans (and if not you can rig them so they are equivalent.)
2) You have a skeletal mesh, that is a bunch of art showing how to draw a skeleton. You can have many skeletal meshes for each skeleton.
3) You have an animation (often, many animations) that show what bones and joints the engine should move over time. Since they work at the skeleton level, you can have different looking humans that all share the same animations.
4) You can have Blendspaces, which combine multiple animations together so that it can smoothly translate from standing to running as you move faster, etc.
5) You can have an animation blueprint, that looks at the state of the character to figure out which animation or blendspace to play.
6) You have Physical Assets for a skeleton, that do important things like collisions and ragdoll effects.
I also showed how to make a simple enemy spawning system. I dropped Target Points around the world, and used the game mode blueprint to randomly pick one and spawn a terminator box on it every second.