https://github.com/vrlabs/collision-detection
VRChat avatar package for detecting player or world collision
https://github.com/vrlabs/collision-detection
Last synced: about 2 months ago
JSON representation
VRChat avatar package for detecting player or world collision
- Host: GitHub
- URL: https://github.com/vrlabs/collision-detection
- Owner: VRLabs
- License: mit
- Created: 2024-03-09T17:39:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-15T14:06:30.000Z (over 1 year ago)
- Last Synced: 2025-03-20T04:59:09.888Z (about 1 year ago)
- Language: C#
- Size: 9.88 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Collision Detection
[](https://github.com/VRLabs/Collision-Detection/releases/latest)
[](https://github.com/VRLabs/Collision-Detection/blob/main/LICENSE)
[](https://img.shields.io/badge/Quest-Compatible-green?logo=Meta)
[](https://unity.com/releases/editor/whats-new/2022.3.22)
[](https://vrchat.com/home/download)
[](https://discord.vrlabs.dev/)
[](https://patreon.vrlabs.dev/)
A contact system to detect world collision.

### ⬇️ [Download Latest Version](https://github.com/VRLabs/Collision-Detection/releases/latest)
### 📦 [Add to VRChat Creator Companion](https://vrlabs.dev/packages?package=dev.vrlabs.collision-detection)
---
## How it works
* A particle dies on collision with colliders, causing contacts to stop contacting each other, causing a boolean to enable.
## Install guide
https://github.com/VRLabs/Collision-Detection/assets/76777936/f9e0b70a-c5ff-43a6-a0ad-b7a3e49f3a63
* Merge the Animator Controller ``Collision Detection FX`` to your own FX Controller, using the [Avatars 3.0 Manager](https://github.com/VRLabs/Avatars-3.0-Manager) tool.
* Drag & drop the ``Collision Detection`` prefab into the base of your Hierarchy.
* Right click and unpack the prefab, then drag & drop it onto your avatar.
* Parent Constrain it to any object in your avatars hierarchy as needed.
* Note: You can move the object as well, but you'd have to repath the animations. One tool for this is [hfcred's Animation Repathing tool](https://github.com/hfcRed/Animation-Repathing)
> [!NOTE]
> When building for Quest, you will have to remove unsupported components and shaders
## How to use
* After parent constraining/moving the object as needed, you can scale the object to obtain the desired range.
* Note: To change the collision requirements, you can change the Layers in the `collision` module, or disable the `collision` module and enable the `triggers` module to select specific trigger colliders.
There are three important bools in your FX Controller:
* ``CollisionDetection/IsColliding``: Whether or not the component is currently colliding with a collider.
* ``CollisionDetection/AlwaysReset``: Whether or not IsColliding should go to false immediately after stopping collision, or stay on until the Reset bool is enabled.
* ``CollisionDetection/Reset``: If ``CollisionDetection/AlwaysReset`` is false, this bool is used to reset the IsColliding state.
## Performance stats
```c++
Contact Senders: 1
Contact Receivers: 1
FX Animator Layers: 1
Particle Systems: 1
```
## Hierarchy layout
```html
Collision Detection
```
## Contributors
* [hfcred](https://github.com/hfcred)
* [jellejurre](https://github.com/jellejurre)
## License
Collision Detection is available as-is under MIT. For more information see [LICENSE](https://github.com/VRLabs/Collision-Detection/blob/main/LICENSE).
[
](https://vrlabs.dev "VRLabs")
[
](https://discord.vrlabs.dev/ "VRLabs")
[
](https://patreon.vrlabs.dev/ "VRLabs")
[
](https://twitter.com/vrlabsdev "VRLabs")