How to fire a gun (or any animation) with gestures in VRChat

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi in this video I want to show you an easy and comfortable way how you can for example fire off a gun or basically toggle any event in VR chat with a simple gesture such as pulling your Trigger or making a fist this video was requested by Tinky Winky Taylor I hope this is actually what you wanted and what I'm about to show you is helping you one thing I want to mention before starting in this video I won't explain how the grabbing of the gun or the prop works I made a specific video for that which I'll link up there in the corner and also down in the description if you're looking for that please check out this tutorial here I will only focus on the firing off the gun all right so this is basically where we left off in the other tutorial we have two states where the prop is at the hip and then one state where the prop is in the hand in our case this is the gun the only difference in the other tutorial I grabbed the prop when I have just tried equals one which is a fist in this case I want to grab the gun when I have my finger pointed out which is gesture free and now when I make a fist or I pull the trigger I want to shoot off the gun first of all focus on the logic so we create a new state which will be the shoot State make a transition make another transition I will call it shoot and it's very simple the only thing you need to do is make another condition gesture right equals one and then we go back when just to write equals not one and basically that's the logic we cannot shoot as long as the gun is at the hip as soon as we have the gun in our hand we can shoot it off by making a fist just your right equals one I will also get rid of the exit time and make the transition very quick then we just need to drag in our shoot animation that we want to fire off when we pull the trigger and that's basically already it one last important thing we need to select the animation and disable Loop time otherwise we keep firing off all the time as long as we have the fist gesture we only wanted to play once until we let go of the trigger and then press it again now I'll quickly demonstrate how my shoot animation looks like in this case I'm not the greatest with animating and particles but just to showcase everything I'm doing is essentially toggling three objects audio ballad and muzzle flash if we go here this is the gun and we have three objects that are currently disabled a bullet if we enable it and play it it fires off a bullet uh here's the details on how I made this if you want to copy it exactly I don't remember it's been ages uh uh so yep that's how that looks like then the muscle flash which looks like this if you play it and we have these things here if you want to copy it once again I made this ages ago and I don't remember how I did it I just know that I had a lot of pain trying to get the setup and then we have an audio clip of the gunfire if it gets enabled play on the wake is ticked on so it will fire off the Audio I start off the animation by actually having a keyframe of everything disabled and then I wait a little bit after five frames I toggle everything on and then I wait five frames again with another keyframe where everything is still toggled on originally I had this all like in just one frame but then it would sometimes not fire off properly so that's why I spaced it out now and now it seems to fire off every single time I try to shoot the reason why I start with it being toggled off and and in toggle on is because when we're playing off the shield animation we play it and then if we let go of the trigger it goes back again but that doesn't mean that our sound file is already completely played off or the animation so even if the animation is not playing anymore we just need to toggle it on and then after the animation stopped playing we still need all of these three objects to be toggled on so that they can finish their animation however if it's enabled and then we shoot again and it's still enabled it won't do it because it only fires off if it is disabled and then gets enabled this is the play on awake uh toggle that we have here so that's why I start with the First keyframe with it being disabled at the start of shooting off it will disable it and then enable it so it will definitely play off all the effects that we want all right that's how I did I hope this was helpful to you if you have any further questions feel free to ask them Below in the comments I'll try my best to answer them if I know the answer of course if you have any other topic that you're confused about or where you would appreciate a tutorial about something specific feel free to let me know as well I might consider making a video about it depending on my own knowledge about the topic I wish you all a wonderful rest of your day see you next time and bye bye
Info
Channel: Airpaca
Views: 571
Rating: undefined out of 5
Keywords: Airpaca
Id: KTH87-2ih30
Channel Id: undefined
Length: 5min 20sec (320 seconds)
Published: Fri Jun 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.