Character Setup help

I am trying to make a basic setup for the character for my game, but I’ve run into some problems.

  • When the sword swinging animation plays, only the verticies of the sword are moved by the armature bone, not the collison bounds.
  • I need to have it so that the character can only jump when he’s on the ground, but if the top of the hit box is touching a ledge he can still jump. I tried to create a seperate box at eh bottom of he hitbox, but that didn’t work, it only moved part of the time.
  • Why does the character “jump” forward sometimes. If you exit the camera view and look at teh scene you can see this more clearly.
  • At the moment you can only move forward when you’re on teh ground, how can I make it so you can move forward int e air, but not as fast as when you’re on the ground.
  • I had another one but I can’t think of it.
    When This work the way I want it to I will convert all of it to python. Any help is greatly appreciated. And here is the current blend.

Attachments

character_setup.blend (307 KB)

1- parent a collision box to the bone.
2- this is a toughy- you could try casting rays down, but if you’re standing such that none of the rays hit it’ll return as you being in air. Ideally you’d be able to check when there’s an upward force on the character, but there’s not enough access to the physics engine as of yet.
3- I don’t see teh jumping, it might be your computer?
4-make another set of motion actuators, set to slower speeds, and plug them into keyboard sensors and a duplicate of your ground collision, but set to inverse. This is much cleaner in python.
5- you were going to ask how to send me all your money.

Thanks Cap’n. What do you mean byparenting a collision box to the bone?

add a cube and scale and position it to fit around the sword, then select the box, then shift-select the bone (the armature has to already be in pose mode) and hit ctrl-p. Select “bone” from the dialogue. (if you parent to armature the vertices of the box may move but the bounds wont; to bone means the entire object follows the bone)

Thanks again. I’ve got another question, when I walk forwrd and the sword touches the cube it registers as a hit, is there anyway of only counting damage when the sword is swinging? The onlything I can think of is have a non-actor sword most of the time, then replace it with an actor sword while the animation’s playing.

Can any body help. If there is no other way than I said ealier, how would I be able to replace it only when the animation is playing?

Somebody has to know what to do. Any help please?

Hi haven’t read the whole thread nor have I downloaded the blend so if I am totally off the mark I apologise. The one way I solved the sword issue is by having the sword add a collision object that is parented to the sword but disapears at the end of the animation.
or you could try having the animation define a “hit” property. Then the sword only registers a hit (using the expression controller) when the property is within a certain range eg hit<0.
Hope that helps

Thanks Jaechild.