I’m developing a fighting game with Mecanim Animation (Humanoid) without Physics.
I have two fighters (fighterA and fighterB). Each fighter has HitBox and StrikeBoxes.
HitBox = animated hidden game object, box collider with IsTrigger = false, rigidbody with IsKinematic = true.
StrikeBox = animated hidden game object, box collider with IsTrigger = true, rigidbody with IsKinematic = true.
There are several strikes animations that change the position of a fighter. Both fighters can move simultaneously.
How best to prevent the crossing of fighters and pass through each other without ending current strike animation? RigidBody.SweepTest and Animator.MatchTarget?
Is it possible in Mecanim to somehow get the Bounds of the fighter object based on current strike animation?
How to get in Mecanim the position of an fighter object at a particular time of the animation (for example at the end, or in a certain frame)?
In most fighters when you hit someone there is a push back applied to the other character’s collider. i don’t think this has any thing to do with mechanim.
Once your character has been hit by collision or trigger or whatever can send your script a message that your character should blend/crossfade to the hit animation from whatever frame it was in when hit. It’s all about blend trees and the data types that can be used with mecanim. There is a good vid on the Unity Youtube home page by the mac daddy of Unity Will Goldston.
All the examples I’ve seen use the trees for the transitions between the walk - run.
You mean you have to use the blend tree of the states strikes, idles, jumping into the states getting hit?
Now i have the controller contains states such as - Idles.SimpleIdle, Idles.GuardIdle, Moves.Forward, Moves.Backward, Strikes.Kick, Strikes.Punch, Damages.GetHit…and so on, about 20 types of strikes, jumps,
In controller i have parameters - IsMove, MoveType, IsIdle, IdleType, IsStrike, StrikeType, IsDamage, DamageType…
I have the transitions between these states in terms of parameters. Not quite understand how to use this blend of trees.
I can not find the video, maybe you can give a link?
Here is a link to all the vids at the home page there are around 90 of then done by Unity but only a couple are for mecanim by Unity. If you Search a little further for third party tutorials you will find some good tutorials for mecanim. The few videos by Will Goldston are very well put together and explain a lot from basics on up. You may already know everything there is to know in the vids so I hope that they are useful for your particular needs. I’m no mecanim pro but I know my way around a blend tree lol. It looks like you have a lot of animations to assign to a tree. If I remember correctly from the vids , it’s possible to use vars to control what animation will blend next. Meaning that if a value is compared in a condition (eg if(blendValue==0.1) ) then blend a certain animation. So if your player gets hit half way through the strike anim set the float to a value that will blend a parry or block animation.
Hope this helped. I’ll keep looking for the exact blend tree vid and link it for ya when I have a chance.
What type of position changes better for fighters in fighting game without the use of physics? Position which changes by animation (from 3d max for example) or the position of fighters changes in script (Transform.Translate for example) while playing the corresponding animation.