Animation/Action/NLA Help

About Me:
Hello, I’m new here. I’m an artist and not a programmer. I’m struggling with the logic bricks and python is beyond me. I generally don’t do well in online communities plus I have Asperger’s Disorder (I really do suffer from it, I’m not one of those self-diagnosed crazies that think they are from Atlantis or whatever), please have a little patience with me if I make a faux pas.

The Problem:
I need help with actions in the game engine. Ive been trying to figure this out for 2 solid days, 12 hour days. Im beginning to feel like I’m really stupid or this is insanely complicated. I’m not even sure where to begin but I’ll give it a try.

I’ve tried rigging my mesh with a skeleton. It’s a swishing tail on a creature. I set the keys and it appears to work. First, I tried to add it with actuators as an IPO (Always>AND>IPO>Flipper>str: 1, end: 30). Nothing happens. So I create an action and I set up the actuators to add it as an action in the game and I get nothing (Always>AND>IPO>Flipper> AC: [name]>str: 1, end: 30). I’ve even tried to have the animation triggered by Near (to my player), keyboard and mouse clicks, just to see if it worked at all with any input. Finally I said, screw the bones animation, I’ll go with old fashioned vertex animation so I tried using hooks and again, the same result. There’s another thing called Shape keys, I’m not sure if I need those. I’m confused about what parts work in the game engine and what don’t ( for example, was pretty annoyed to find out path animations don’t work in the game engine).

There are so many different keys that have to be set in so many different windows, I’m getting lost on what needs to be done where. I’ve followed tutorial after tutorial. I simply don’t get it. I just want the tail to swish back and forth independently of the creatures movement around the environment (regular movement and setting keys for that, etc hasn’t been a problem). I’m not trying to do any sort of AI or have it controlled. It’s just a mindless piece of animated decoration. I would think this is simple but the Actions and NLA editor are baffling me.

If you post your .blend file on http://www.pasteall.org/blend, people will be able to answer you a lot quicker as they can just look for the problem instead of asking a bunch of questions.

However, are you doing anything complicated with the armature? Such as constraints or anything? Or are you using just plain old forward kinematics?

Also, welcome to Blenderartists!

Ok, here is the blend file(s). One is just the plain file and the other (which is significantly larger) is a packed version, in case you’re curious about what it looks like with all textures and stuff, you can even take a peek the next environment I’m working on. In these files the creature is unanimated but it is rigged. I burned through so many iterations that didn’t work, I didn’t keep them. I didn’t want to get them mixed up and accidentally delete my original unaltered file. As I said in the early post, I want the tail to swish back and forth independently of the final movement around the environment, which I will eventually animate at some point.

Small version (5.1MB): http://dl.dropbox.com/u/2929782/Zlythy_alpha/zlythy_work_02.blend
Big version (54.3mb): http://dl.dropbox.com/u/2929782/Zlythy_alpha/zlythy_work_02_packed.blend

I’m not entirely clear on what forward kinematics are. From what I read, I think it’s the old style of moving the different bits around manually? The original bones animation I made was done with Auto IK turned on. I found a thread on this forum from 3 years back they stated IK didn’t work in the game engine and neither did moving individual bones… which kind of makes rigging useless. I tried to follow some tutorials on shape keys and “bake” the meshes, apparently this is how it has to be done for the game engine (which seems crazy to me but then so does the lack of path animations in the ge). However, later I found a recent (2009) blender developers mailing list thread in that stated that IK did work in the game engine. Or maybe they meant something else. So I’m a bit confused now. Anyway, I tried using hooks to animate the vertices directly. That worked when I set the keys and played it back in the regular timeline… thing. There are at least 3 or 4 different timelines (timeline, action, nla, ipo), I honestly get lost on which ones are relevant anymore. But as soon as I tried to use it in the game engine, nothing happened.

And thank you!

What you found about IK in the game engine is real time IK. For example, you can use python to move the hand bone, and the rest of the arm would follow with IK.

The best way to do what you want to do is with actions. So animate your guy with bones like it seems like you did before. Now name the action something meaningful like tailSwish or something. From there it is time to set up some logic bricks:

Sensor: Always
You will want to make sure pulse mode is on, this will make the game trigger the sensor repeatedly rather than once. To do this click on the 3 dots under where you can set the sensor type. Use the raised set of dots for true level triggering.

Controller: And

Actuator: Action
First of all, if this actuator does not show up, make sure you are applying the logic to the armature. For now keep the play type as play, and experiment with it later. Where it says AC:, type in your action name exactly how named (case sensitive). So if you named the action tailSwish, it should look like “AC:tailSwish” (with out quotes of course). Now set the start and end frames of your action.

That should get things going, good luck.

The real-time IK is not in the 2.49b game engine, but it is in the 2.5 game engine. 2.5 beta0 is due out soon. :slight_smile:

I took a look at the first blend, and I noticed that the armature did not have an action. I’m currently trying to find a tutorial that should help you.

EDIT:
The wiki might be able to help you:
http://wiki.blender.org/index.php/Doc:Manual/Animation/Armatures

I’ve tried this over and over again minus the pulse thing. I just animated it and added the action exactly as you said and it’s still not working. I’ve reuploaded the file if you’d like to take a look: http://dl.dropbox.com/u/2929782/Zlythy_alpha/zlythy_work_02.blend

Yes, I mentioned that it was the file before any animations or actions applied. However, did you see any problems with the armature or anything else? I’ve just uploaded a version with the animation and action but it’s still not working in game mode.

Ok, time to try this again (ba went down after I tried submitting the last reply)

How did you set up your armature to control your mesh? I removed the armature modifier, cleared parenting, and reparented the mesh to the armature using bone heat. I used keep track for clearing the parents, and when I reparented I had the armature in the middle of the animation so it was all straight :stuck_out_tongue: .

I added a column of key frames at the end of the action so I could watch it swish back and forth, so you can take that out if you want (if you do make sure to set the end frame back to 30). I also broke your mouselook trying to find the problem, so you will have to go back to your camera and fix up the logic breaks (sorry :stuck_out_tongue: ).

Here is the blend with the changes I have made:
http://pasteall.org/blend/1066

Good luck, and feel free to ask me any questions you have about what I did.

Simply put:

when you parent a mesh to a bone, NEVER make the “Armature parent deform” Real to transform it into a modifier. Or else it wont work in the game engine.

So the reason it wasn’t working in the game engine is because I clicked the wrong button when I parented the armature to the mesh? AAAAAHHHH!

Thank you all for the help, especially Kupoman for taking the time to fix the file for me. :slight_smile: