This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
character:hitbox [2014/01/30 00:46] Mistermind |
character:hitbox [2022/07/27 03:39] (current) Mistermind |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Hit Box Setup ====== | ====== Hit Box Setup ====== | ||
- | 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 " | + | 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 " |
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: | 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: | ||
Line 10: | Line 10: | ||
- | 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. | + | UFE uses a similar technology: if a //hitbox// and a // |
- | Similar to Marvel vs Capcom 3 series, | + | UFE uses circles |
- | {{: | + | {{ :character:character_hitboxes1.png?nolink |}} |
- | ---- | + | Make sure you first set your character model(s) under [[character:prefabs|Character Prefabs]] before proceeding to the sections below. |
- | + | ||
- | ==== Character Prefab ==== | + | |
- | **Choose a character | + | |
- | * Animation | + | |
- | * (SOURCE VERSION) Hit Boxes Script ('' | + | |
- | * (OTHER VERSIONS) Hit Boxes Script ('' | + | |
- | + | ||
- | or | + | |
- | **Create a character prefab:** Create a character prefab from your character model | ||
- | * Drag your character model from your project folder to the **Hierarchy** | ||
- | * If it doesn' | ||
- | * Using the Project window, navigate to '' | ||
- | * Once you're done, drag the character back from Hierarchy to your desired folder in the Project window. Unity will automatically create a prefab. | ||
- | |||
- | {{ : | ||
- | |||
- | 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 " | ||
---- | ---- | ||
- | |||
==== Transform ==== | ==== Transform ==== | ||
- | Works similar to Unity' | + | Works similar to Unity' |
- | Adjust your character' | + | |
**Notes:** | **Notes:** | ||
* Avoid changing the character' | * Avoid changing the character' | ||
* Even though you can use the standard t-pose as the default animation when importing your character, its recommended that you use the idle animation as your character' | * Even though you can use the standard t-pose as the default animation when importing your character, its recommended that you use the idle animation as your character' | ||
- | * Make sure you adjust the characters rotation as you would like to see them on screen. 2.5D Fighting games tend to have more " | + | * Make sure you adjust the characters rotation as you would like to see them on screen. 2.5D Fighting games tend to have more " |
* Don't worry about mirroring your animations. UFE will take care of that for you. | * Don't worry about mirroring your animations. UFE will take care of that for you. | ||
---- | ---- | ||
- | |||
==== Hit Boxes ==== | ==== Hit Boxes ==== | ||
- | Tag your character' | + | Tag your character' |
- | * **Body Part:** A tag representing the body part inside UFE. | + | |
+ | {{ : | ||
+ | |||
+ | * **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**: | ||
+ | * (Rect) **Follow Bounds (X/Y):** Toggle this if the rectangle shape is to follow the bounds of the character. | ||
* **Collision Type: | * **Collision Type: | ||
* Body Collider (yellow hitboxes): Movement and hit collision. Opposing yellow hitboxes cannot overlap. | * Body Collider (yellow hitboxes): Movement and hit collision. Opposing yellow hitboxes cannot overlap. | ||
* Hit Collider (green hitboxes): Hit collision only. Opposing green hitboxes can overlap. | * Hit Collider (green hitboxes): Hit collision only. Opposing green hitboxes can overlap. | ||
* No Collider (white hitboxes): No collision. Use these for body parts that are not considered hitboxes but can be a [[move: | * No Collider (white hitboxes): No collision. Use these for body parts that are not considered hitboxes but can be a [[move: | ||
+ | * Throw Collider (red hitboxes): Used to detect attacks that have hittype of Throw. | ||
* **Hit Box Type: | * **Hit Box Type: | ||
* High: If a non-knockdown attack hits this hitbox, '' | * High: If a non-knockdown attack hits this hitbox, '' | ||
* Low: If a non-knockdown attack hits this hitbox, '' | * Low: If a non-knockdown attack hits this hitbox, '' | ||
- | * ** Off Set:** Off set the hit boxes around | + | * **Default Visibility:** Set the default visibility for certain Game Objects under your character |
- | * **Radius:** How big the hitbox is. Its recommended that yellow hitboxes cover as much ground as possible to avoid unexpected cross-overs during battle. | + | |
- | * **Link:** The body part related to the character on screen. Navigate through | + | |
**Note:** | **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 " | + | * Each bodypart should be unique. |
+ | * If you rigged your model using [[https:// | ||
+ | * 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 " | ||
+ | |||
+ | ---- | ||
+ | ==== Related Video Tutorials ==== | ||
+ | {{youtube> | ||
+ | |||
+ | {{youtube> | ||
+ | |||
+ | |||
+ | |||
+ | ---- | ||
Code example: | Code example: | ||
<code c#>void OnHit(HitBox strokeHitBox, | <code c#>void OnHit(HitBox strokeHitBox, | ||
Line 72: | Line 72: | ||
}</ | }</ | ||
- | ---- | ||
- | |||
- | Related Video Tutorial:\\ | ||
- | {{youtube> | ||
---- | ---- | ||
[[character: | [[character: |