- Home /
Best way to go about believable 2 Character Grab/Lift animation?
Hello, I need to make a scene where I am chasing another character and they may not be in the same lane or height. Both characters are dynamic with character controllers and have one being controlled by the AI. And I need to jump over/leap/tackle/hit or do much more and all should be dynamic and can fail midway if the collision fails due to changes in speed or other events.
I am using Mecanim state machines for all my animations.
Now the way I think they might have done it in subway surfers is actually create the Cop & the Player as 1 skinned mesh with animations for :
Kid doing Graffiti
Kid Running/Jumping/Rolling (without the cop inside the view)
Kid Running/Jumping/Rolling (while being chased by the cop inside the view)
Kid losing balance after almost crashing (with the cop appearing into the view for 2 seconds)
Kid getting hit by train
Kid crashing and getting caught/carried & lifted by the cop
Kind of like this : https://www.youtube.com/watch?feature=player_detailpage&v=WXnWTK1JmWY#t=27s
So... how do you do it? How do they do it in say Football games where one player can make the other one fall by pushing him? Or In some high-end RPG games where two characters exchange items by hand? Or wrestling games where people lift/grab each other?
Let me know please.
Thanks!
Answer by DavidDebnar · Jun 13, 2013 at 06:21 AM
Usually they are 2 separate meshes/objects, not one. In wrestling games, for each attack there's animation for the attacker and the defender. When the guy attacks, it adjusts his attack a bit - move hands to the body, etc., so it doesn't matter where he's standing and also forces to play the defending animation on the other guy. So basically - have 2 animations one for the cop and one for the runner. When the runner dies, wait until the cop gets to the player and then play both animations.
So you use I$$anonymous$$ and Animator.$$anonymous$$atchTarget to make sure the rest is fine, is it? And I guess the offset between the cop and the thief will have to be hardcoded and fine tuned so that the cop stands right next to the kid before he starts playing the animation of picking him up. I hope I don't need Pro features to do this.
PS. This is for a chase sequence. Not for a subway surfers ripoff :P
Exactly as $$anonymous$$ explains perfectly.
Also Tri, just in answer to a more basic question you could be asking: yes it's completely normal in video games that you swap something for another version of itself, when stuff happens.
For example, someone was just asking "how do you break a bumper off a car". in fact, you don't really. you swap from your set of things "car with bumper" to your other set of things "car with bumper broken off, and the bumper"
Another typical example is when some biped blows up, you swap from your walking whatever biped ro your ragdoll biped. When a spaceship explodes, you swap at that instant to your "exploding spaceship" rig.
The PLAYER has NO CLUE this is happening, but it is actually utterly different models/systems.
In your example you might have, whatever, some character controller or something. BUT when you do the pick up (or whatever) you woudl swap to an utterly different, perhaps much more complicated system -- likely what $$anonymous$$ describes
I notice this question comes up a lot on this site -- I think new hobbyist game devs, don't realize that this is a normal thing in 3D video games - you seamlessly swap between (utterly different) versions of a thing, even though the player is totally unaware of this ... again typical examples being swap to a ragdoll, swap to an "explodable version" swap to a "climbing in the car version" or whatever.
Hope it helps!
Hey! Thanks $$anonymous$$ & Fattie for the answer. I guess I will have to do it the hard way. :)