This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
character:hitbox [2014/10/30 19:24] Justin H. |
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 16: | Line 16: | ||
{{ : | {{ : | ||
- | ---- | + | Make sure you first set your character model(s) under [[character: |
- | ==== Character Prefab ==== | ||
- | **Choose a character prefab:** A prefab containing the following components | ||
- | * 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 drag your newly created prefab to the //Character Prefab// in the Hit Box Setup panel. Once you have your character in, you can click on "Open Character" | ||
---- | ---- | ||
- | |||
==== Transform ==== | ==== Transform ==== | ||
Works similar to Unity' | Works similar to Unity' | ||
Line 48: | Line 30: | ||
---- | ---- | ||
- | |||
==== Hit Boxes ==== | ==== Hit Boxes ==== | ||
- | Tag your character' | + | Tag your character' |
{{ : | {{ : | ||
Line 65: | Line 46: | ||
* 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. | + | * 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, '' | ||
+ | * **Default Visibility: | ||
**Note:** | **Note:** | ||
Line 75: | Line 57: | ||
* 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 " | * 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 80: | Line 72: | ||
}</ | }</ | ||
- | ---- | ||
- | |||
- | Related Video Tutorial:\\ | ||
- | {{youtube> | ||
---- | ---- | ||
[[character: | [[character: |