One of the key ingredients of any fighting game are hitboxes. 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: if a hitbox and a hurtbox are overlapping then a hit is confirmed.
UFE uses circles and rectangles as hitboxes which gives you a wide variety of game play to work with. Circles and rectangles can be used simultaneously, UFE will detect hits between any combination of hitbox/hurtbox shapes.
Make sure you first set your character model(s) under Character Prefabs before proceeding to the sections below.
Tag your character's body parts to the hit boxes, set its shape, size, collision type and hitbox type.
Body Part: A tag representing the body part inside UFE.
Link: The body part related to the character on screen. Navigate through the mesh and select the bone that best cover the selected body part.
Shape: Circle or Rectangle shape hitbox.
(Circle) Radius: How big the hitbox is. Its recommended that yellow hitboxes cover as much ground as possible to avoid unexpected cross-overs during battle.
(Circle) Off Set: Off set the hit boxes around the character body if needed. Be careful with high values, as different animations can cause unexpected positioning.
(Rect) Rectangle: X and Y make up the bottom left corner; W and H is the size calculated as distance from X and Y respectively.
(Rect)
Follow Bounds (X/Y): Toggle this if the rectangle shape is to follow the bounds of the character. Note that this uses Unity's
Renderer Bounds. Adjust W and H to suit.
Collision Type:
Hit Box Type:
High: If a non-knockdown attack hits this hitbox, Get Hit High
animation group is triggered.
Low: If a non-knockdown attack hits this hitbox, Get Hit Low
animation group is triggered.
Default Visibility: Set the default visibility for certain Game Objects under your character hierarchy. This option is useful for hiding or showing certain objects during gameplay (like weapons). This option only works for objects detached from the main
Mesh. You can then toggle the visibility by using
Move Editor -> Body Parts Visibility Toggle.
Note:
Each bodypart should be unique. If any bodypart doubles up, it can cause strange behaviour with hit detection. Use Custom 1-9 if you run out of defined ones.
If you rigged your model using
Mixamo Auto-Rigger you can click on
Auto-Setup for Mixamo Auto-rigger to automatically set the hit boxes of your character.
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!");
}
< Back to Character Editor