.\UFE\Plugin\UFE.dll\HitBoxesScript
if you are not using the source version.This is an old revision of the document!
One of the key ingredients of any fighting game are hit boxes. Different than other action games, 2.5D fighting games rely on precision hits in a more “mechanical” way, as it emulates the sensation of playing a 2D game with the precision (and impact) of well adjusted invisible hitboxes.
There are many types of hitboxes, around, and thanks to the recent use of 3D technology to emulate 2D game play, hitboxes are commonly known for following body joints. Here are some examples:
UFE uses a similar technology, in witch it detects the distance between 2 points in a projected 2D environment and based on the defined radius of the hitbox, determine rather or not a hit should be confirmed.
Similar to Marvel vs Capcom 3 series, UFE uses circles as hitboxes as it uses less processing power and gives you a wider variety of game play to work with.
Choose a character prefab: A prefab containing the following components
.\UFE\Scripts\HitBoxesScript.cs
).\UFE\Plugin\UFE.dll\HitBoxesScript
)or
Create a character prefab: Create a character prefab from your character model
.\UFE\Scripts\HitBoxesScript.cs
1) and, with the character still selected, drag the script to the Inspector window. No further configuration is necessary.
Now just drag your nearly created prefab to the Character Prefab field under the Character Editor. Once you have your character in, you can click on “Preview” to see the character. Now lets configure the hitboxes.
Works similar to Unity's default Transform component. Adjust your character's rotation so it looks like its standing on the left side of the screen.
Notes:
Tag your character's body parts to the hit boxes, set its radius and adjust its behavior.
Get Hit High
animation group is triggered.Get Hit Low
animation group is triggered.Note: After the last step if you can't see the hitbox in scene view, click on Gizmos (top right corner of scene view) and toggle “HitBoxesScript”.
Code example:
void OnHit(HitBox strokeHitBox, MoveInfo move, CharacterInfo hitter){ if (strokeHitBox.type == HitBoxType.low) Debug.Log ("low hit!"); }
.\UFE\Plugin\UFE.dll\HitBoxesScript
if you are not using the source version.