Adding a High Five to your VRChat avatar using the VRChat Contacts system.

  Рет қаралды 1,034

Toolbox Motley

Toolbox Motley

Күн бұрын

The written version of this guide will be pinned to the top of the comments.
Here is the slapping sound I used: freesound.org/...
Here is my Discord channel: / discord
Here is my direct Discord: ToolboxMotley#0372

Пікірлер: 13
@ToolboxMotley
@ToolboxMotley Жыл бұрын
This video will demonstrate the basics of VRChat's Contacts system by walking you through the process of adding a "high five" feature to your avatar. We'll start by adding a Contact Receiver. >Right click your avatar in the Hierarchy. >Create Empty. >Name this object "High Five". >Click the High Five object to bring it up in the Inspector. >Click "Add Component". >Search for "Contact Receiver" and add it. VRChat's Contacts system uses two components: the Sender and the Receiver. The Receiver is the component that will interact with your code and animations, triggering changes to various Parameters when they're activated through contact with a Sender component that has at least one matching tag assigned to it. The Sender is used only to activate the Receivers. They can be given custom tags, which are referenced when the Sender and Receiver touch in order to decide whether or not to trigger the Parameter attached to the Receiver. Hopefully, that brief explanation wasn't too convoluted and confusing; seeing it in action should help to clear it up, so let's continue. >Click "Add" under the "Collision Tags" section. >Click the drop-down menu that says "Custom", and change it to "Hand". This will make it activate any time a Sender with the Hand tag touches it. However, since it will be attached to our own hand, this current setup will make it trigger immediately and perpetually, so we need to prevent that. >Uncheck the box that says "Allow Self". Now, we make it trigger a Parameter. >In the Parameters field, type in "High Five". We want the high five to only activate when you really slap another person's hand, not just softly touch it. >For Contact Type, click the drop-down and select "On Enter". >In the Velocity field, change the number to 0.5. I haven't done enough experimentation to tell you what *exactly* this number means in terms of calculation, but this value seems to work for me. Lastly, we need to attach it to the avatar's hand. >Click "Add Component". >Search for "Parent Constraint" and add it. >Click the + button underneath the "Sources" box. >Expand your avatar's armature in the Hierarchy until you find whichever bone corresponds to your hand. In my case, it's actually the Wrist; generally speaking, it will be the Parent bone to your fingers. >Click the High Five object. >Click and drag the Hand bone into the "Source" field in the Parent Constraint. >Click the "Zero" button. >If necessary, adjust the Radius and Position until the sphere in the viewport comfortably fits in your avatar's hand. As an extra note, you can actually place the bone in the Contact Receiver component's "Root Transform" field, and the receiver will follow that bone as though it were attached to the bone. However, we're using the Parent Constraint method so that we can attach the audio to this same object. We need a slapping sound that will trigger when the high five occurs. I've linked one in the description that you can grab, but you can use whatever sound you like. ( freesound.org/people/oldhiccup/sounds/567605/ ) Once you've gotten a file ready, we can bring it into the project. >At the top left of the Unity window, click "Assets". >Select "Import New Asset". >Locate the audio file you want to use and click "Import". >Click High Five in the Hierarchy. >Click "Add Component". >Search for "Audio Source" and add it. >Click the circle to the right of the "AudioClip" field. >Search for the file you just imported, and add it. The default Audio Source settings will emit this sound to the entire world. While that is indicative of a truly epic high five, it's likely to be disruptive, and the lack of a reverberating echo effect would fail to truly convey its world-quaking intensity. That was a joke. I apologize. >Set the "Spatial Blend" slider all the way to 3D on the right side. >Expand the 3D Sound Settings. >Click the drop-down menu and change it from "Logarithmic Falloff" to "Linear Falloff". I don't know why, but Logarithmic Falloff makes the audio *extremely* quiet. >Set the maximum distance to 2. >Lastly, disable the Audio Source component so that it doesn't play as soon as the avatar loads. We'll turn it on via the animation that we're about to make. That's all of the object work done. Now we can get started on the animation; we only need one, and there's very little involved with it. >Right click in Unity's file explorer. >Create, Animation. >Name this animation "high five". >Click and drag "high five" onto your avatar in the Hierarchy. >Double click "high five" to bring up the Animation window. >>If you haven't already, I recommend dragging the Animation tab into the spot beside the Project and Console tabs to make it easier to access. >Click your avatar in the Hierarchy to make it the focus of the Animation window. >Select "high five" from the drop-down menu at the top-left of the Animation window. >Click the Record button. >Click the "High Five" object in the Hierarchy. >Scroll down in the Inspector, and activate the Audio Source component. >In the Animation window, set the active Frame to 60 using the number field to the right of the Play and Record buttons. >Click the checkbox here to have the animation turn off the Audio Source at frame 60. This is the one-second mark, which gives the sound effect enough time to play fully before being shut off. >Click the Preview button to stop recording and stop previewing. Final stretch, just need to set up the Animator and we'll be ready to go. >Click your avatar in the Hierarchy. >Scroll down in the Inspector until you find the "Playable Layers" section of your VRC Avatar Descriptor component. >Double-click the field to the right of "FX" to bring up your avatar's Expressions Animator. >Click the Parameters top near the top-left. >Click the + button, and add a Bool parameter. >Name this new parameter "High Five", or whatever name you set in the Parameter field of your Contact Receiver earlier. >Also add "GestureRight" as an Int parameter if it's not already in the list. You can use GestureLeft instead if you'd prefer to high five with your left hand. >Click the Layers tab. >Click the + button to add a new layer. >Name this layer "High Five". >Click the gear icon on this layer, and set its Weight to 1. >Right click in the grid to the right. >Create State, Empty. >Click this new State, and use the Inspector to name it "Off". >Create another new State. >Name this one "On". >Right click the "Off" state, Make Transition, to On. >Expand the Settings in the Inspector. >Deselect "Has Exit Time". >Set "Transition Duration" to 0. >Click the + button under "Conditions" two times, as we'll want two different parameters to be true for the sound effect to activate. >Set the first Condition's drop-down menu to "High Five", and set the drop-down beside it to "True". >Set the second Condition to "GestureRight", "Equals", "2". The number 2 corresponds to the open hand gesture. By adding this, you ensure that the sound only activates if your hand is open for the high five. >Create another Transition from On to Off. >Set the Exit Time to 1, and the Transition Duration to 0. This allows the animation to play all the way through before it Transitions back to the Off state. >Lastly, select the "On" state, click the dot to the right of the "Motion" field, search for the "high five" animation, and add it. Unlike most features, parameters activated via Contacts don't need to be included in your avatar's synchronized parameter list. By that same token, you don't need to do anything with your Expression Menu, either. Which means, we're done! You can use Build & Test and get someone else's help to test if it's been set up properly, but bear in mind that the other person won't hear the high five until you've actually uploaded the avatar. For a little bit of added fun, you could add "Head" to the Receiver's list of Collision Tags in order to deliver some face slaps, as well. We didn't use any Contact Senders in this project, but I assure you that they're very easy to work with. They're laid out almost identically to the Contact Receiver, with the exception of the Receiver's Parameter control. You can add whatever Collision Tag you wish to the Contact Sender, and use it to activate any Contact Receiver with the same tag, even if that Contact Receiver is on someone else's avatar. Use this for custom interactions with a friend's avatar, like a pair of Contacts using the "Sword" tag to take off a limb! Or something less violent if you're so inclined. Enjoy high-fiving your friends! If you want to make your high fives more interesting with explosions or other particle effects, or want some other feature added, I do both commissions and tutoring. You can reach me via my Discord channel, which I've linked in this video's description ( discord.gg/aFpkcXxra7 ), or contact me at ToolboxMotley#0372.
@Grey390
@Grey390 Жыл бұрын
Excellent tutorial, the perfect pace and clarity to follow along. There's gonna be so much head slapping in the future
@angelaheart6432
@angelaheart6432 Жыл бұрын
Amazing tutorial with clarity. I am curious, how would it be possible to make it so that you could rapidly high five someone though? I've thought on adding multiple reciever setups for it, but I'm not sure how I'd make it work so that the sound effects/particles I have would stack when they contact. Any insight would be lovely
@ToolboxMotley
@ToolboxMotley Жыл бұрын
Stacking sound effects isn't really viable unless you make multiple objects with that sound effect, and have them trigger sequentially as the high five is activated. However, you can have it restart each time the high five activates. Change the animation so that, instead of simply activating the sound effect for one second, it instead *turns off* the sound effect in the first frame, and then turns the sound effect on in the next frame. This resets the sound, allowing it to trigger as soon as it turns on again (which is right away, since the second frame turns it on). As for particles, give the system a really high Emission Rate Over Time so that it's guaranteed to get some particles out, and then make your animation turn on the emission for one frame before turning it right back off so as to not constantly emit particles. Finally, on the animation state that contains the high-five animation, create a new Transition straight back to the same state (from "On" to "On"), with Exit Time and Transition Duration set to 0, and the Conditions of "High Five Equals True" and "GestureRight Equals 2". This makes it so that the animation can restart if the conditions are met again while it's still playing.
@Searzul3569
@Searzul3569 Жыл бұрын
Hey bud - was curious if you could make a turorial for a drone or that multi-cam security system you showed?
@ToolboxMotley
@ToolboxMotley Жыл бұрын
Those are both relatively long projects to set up, but I'll throw it into my list of considerations. X)
@Dr4gonBorn_
@Dr4gonBorn_ Жыл бұрын
I'm new to unity and this helped a lot, but is there a way to toggle this to be active or inactive? I don't want to head pat someone and end up slapping them lol.
@ToolboxMotley
@ToolboxMotley Жыл бұрын
Yup! Just add a basic toggle for whether you want it to be on or off (I have a tutorial on toggles as well, if you need that information). Then, in the Transition for turning on the sound effect (in your FX Controller), add a second Condition that requires the toggle to be turned on.
@Sweetteadragon716
@Sweetteadragon716 Жыл бұрын
Having an issue where I am unable to scale down the the contact reciver (for refrence im trying to make it so that when i slash someones torso with a sword, it will make a blood effect)
@ToolboxMotley
@ToolboxMotley Жыл бұрын
The Contact settings will sometimes require absurdly low numbers to shrink it down enough to notice. Have you tried values of 0.00001 and below?
@Sweetteadragon716
@Sweetteadragon716 Жыл бұрын
@@ToolboxMotley Tysm! Doing this fixed my issue and I really appreciate it!
@watchm
@watchm Жыл бұрын
Make a tutorial on how to hide a body
@hinab
@hinab Жыл бұрын
disabled skinned mesh renderer using animation+toggle
How to add a simple toggle to your VRChat avatar.
6:16
Toolbox Motley
Рет қаралды 8 М.
Cinematic Motion Capture With Move One and Metahuman Animator - Unreal Engine 5.4  Beginner Tutorial
2:11:57
The Darkest Age - Unreal Engine Animations
Рет қаралды 20 М.
Хасанның өзі эфирге шықты! “Қылмыстық топқа қатысым жоқ” дейді. Талғарда не болды? Халық сене ме?
09:25
Демократиялы Қазақстан / Демократический Казахстан
Рет қаралды 325 М.
"كان عليّ أكل بقايا الطعام قبل هذا اليوم 🥹"
00:40
Holly Wolly Bow Arabic
Рет қаралды 4,7 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 262 #shorts
00:20
Osman Kalyoncu
Рет қаралды 4,5 МЛН
How to Create Contacts for your VRChat Avatar Tutorial
7:08
Burnaking
Рет қаралды 16 М.
How to upload a VRChat Avatar - Complete Guide! [PC, Quest & VRoid]
14:57
The Virtual Reality Show
Рет қаралды 226 М.
Basics of Creating a VRChat World | No Blender
19:20
Rabbi32
Рет қаралды 21 М.
VRChat Avatar Dynamics Tutorial - Contacts
7:15
Sipp's Avatar Box
Рет қаралды 107 М.
(Blender) Understanding Weight Paint.
9:57
Pup
Рет қаралды 7 М.
Proximity Contacts For VRChat Avatars!
9:51
PxINKY
Рет қаралды 6 М.
Making the First Character for my Game | Devlog
10:47
Legend 64
Рет қаралды 191 М.
Хасанның өзі эфирге шықты! “Қылмыстық топқа қатысым жоқ” дейді. Талғарда не болды? Халық сене ме?
09:25
Демократиялы Қазақстан / Демократический Казахстан
Рет қаралды 325 М.