https://github.com/vrlabs/selective-animation
System for playing animations for only a single player in an instance
https://github.com/vrlabs/selective-animation
Last synced: about 1 year ago
JSON representation
System for playing animations for only a single player in an instance
- Host: GitHub
- URL: https://github.com/vrlabs/selective-animation
- Owner: VRLabs
- License: mit
- Created: 2023-09-11T19:18:15.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-02T20:34:09.000Z (over 1 year ago)
- Last Synced: 2024-12-02T21:30:31.705Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 18.3 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Selective Animation
[](https://github.com/VRLabs/Selective-Animation/releases/latest)
[](https://github.com/VRLabs/Selective-Animation/blob/main/LICENSE)
[](https://img.shields.io/badge/Quest-Incompatible-red?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/)
System for playing animations for only a single player in an instance

### ⬇️ [Download Latest Version](https://github.com/VRLabs/Selective-Animation/releases/latest)
### 📦 [Add to VRChat Creator Companion](https://vrlabs.dev/packages?package=dev.vrlabs.selective-animation)
---
## How it works
* The system is built using two [Raycasts](https://github.com/VRLabs/Raycast-Prefab).
* The two raycasts are slightly offset from each other, and one has a contact sender on it, while the other a contact receiver on it.
* When pointed at a player, both raycasts will collide with the player only on their screen, because the PlayerLocal collider only exists on their side. This means the Contact Sender and Receiver will only make contact for the player the system is pointing at.
## Install guide
https://github.com/VRLabs/Selective-Animation/assets/76777936/3dc5d6d8-8855-4bef-9398-62fd3522a69e
* If you dont already have [Final IK](https://assetstore.unity.com/packages/tools/animation/final-ik-14290) installed, download and install the [Final IK Stub](https://github.com/VRLabs/Final-IK-Stub).
* Note: Testing in Unity is not possible when using the Final IK Stub!
* Drag & drop the ``Selective Animation`` prefab into the base of your Hierarchy.
* Right click and unpack the prefab, then drag & drop it onto your avatar.
* Expand the prefab hierarchy and find ``Selective Animation Target``
* Move ``Selective Animation Target`` outside of ``Selective Animation`` and place it anywhere in your avatars hierarchy as needed.
* Adjust the rotation so the laser points in the desired direction.
* The laser can be disabled or deleted.
## How to use
* Add the bool ``SelectiveAnimation/IsSelected`` to your FX controller.
* When the system is pointing at a player, the bool will be ``True`` only for the player it is pointing at.
* Use the bool as a transition condition to make animations visible to only the one player.
## Additional notes
* VRChat uses Final IK v1.9. If you are using a different version you may experience differences in behavior when testing with Final IK.
## Performance stats
```c++
Constraints: 3
Constraint Depth: 2
Contact Receivers: 1
Contact Senders: 1
```
## Hierarchy layout
```html
Selective Animation
|-Raycast Container
| |-PlayerLocal Raycast Sender
| | |-LimbIK
| | | |-Grounder
| | | | |-Offset
| | | | | |-End
| |-PlayerLocal Raycast Receiver
| | |-LimbIK
| | | |-Grounder
| | | | |-Offset
| | | | | |-End
| |-Sender
| |-Receiver
| |-Laser
|-Selective Animation Target
```
## Contributors
* [hfcRed](https://hfcred.carrd.co/)
* [jellejurre](https://github.com/jellejurre)
* Wakam
## License
Selective Animation is available as-is under MIT. For more information see [LICENSE](https://github.com/VRLabs/Selective-Animation/blob/main/LICENSE)
[
](https://vrlabs.dev "VRLabs")
[
](https://discord.vrlabs.dev/ "VRLabs")
[
](https://patreon.vrlabs.dev/ "VRLabs")
[
](https://twitter.com/vrlabsdev "VRLabs")