[edit] I’m leaving this stuff all here in case someone wants to try to pull it apart and figure out how to make a better version, but it dun broke in one of the recent versions of Blender and I’ve fallen behind on the changes to BGE python so I’m not sure what’s wrong. Pretty sure the last version I confirmed it working in was 2.68a, and as of now (2.75 is the current version while I’m writing) it’s definitely not working. (To get it to stop throwing errors you’ll have to add “import bge” to the top of the Control script, it seems at some point bge stopped being automatically imported by default)
Current latest version: TPS Walk Rig 0.0.61.blend (1.61 MB)
I initially made this for someone in a support thread, but then I kept adding to it and now it’s got enough features that I think it’s worth letting other people to see. Perhaps you guys who are learning python can get a sense for how it might be used in conjunction with animations to make some natural character movement.
The script and rig are a bit messy since I have been adding features as I went, so it may be better to learn individual techniques and methods from this file and make your own cleaner version (or a version that suits your purposes better)
Essentially it’s a demo of how four action channels can be played at once with varied weights to make a character smoothly blend between walking in different directions and going from a walk to a run. It also has a simple rig setup to tilt the camera as the character aims and looks up and down.
I went a little overboard with the comments since I hopefully want it to be something that can be understood by a wider range of people, so apologies if some of the concepts I explain seem a little basic. Conversely, please tell me if something is cryptic or doesn’t make sense (or if you notice I did something stupid or missed something obvious)
I invite you to walk, run and aim, while watching the feet. Notice how if you turn the feet adjust with the turn, and as the character changes speeds the animations blend from a walk to a run.
The controls are the mouse to look around, W, S, A and D to walk, shift to run, right click to aim and left click to fire, tab to switch the camera to the other shoulder.
If you use the script directly in your game, I would appreciate a credit- if you just learn from it then the learnin’ is all yours. The rest of the assets were thrown together in extremely little time so y’all are welcome to 'em. Apologies for the shoddy animations.
[edit] now with a preview video, and a bug fix (forgot to change the action layer test for the shooting when I rearranged the action layers)
Older versions:
TPS Walk Rig 0.0.5.blend (1.55 MB)
TPS Walk Rig 0.0.6.blend (1.6 MB)