Heyo, Bush here. Learning unity and VRChat together is hard, especially when there aren't enough videos to get you started. Hopefully I can help with that! I hope to make tutorials that are fast and to the point. Ones that you can look over without have to resort to 2x speed, but also contain everything a newcomer would need, should they be willing to slow the video down and pause where needed. Hopefully that seems appealing to you as much as it does to me!
I started learning right from the public launch of udon, so I don't claim to be the best (I can think of many more knowledgeable than me), but I do love to share what I do know. If you can script something better, please feel free to post a better version in the comment section of the video. Would love to hear your solution!
omg dude simply going over keyboard shortcuts is fucking huge for me. I've been trying to figure out how to paste shit right where my camera is for ages! ty
@@kasferret the simplist way would be to add some colliders around the stage, and then respawn the obj when it touches any of the colliders. I made a followup video a whole ago showing how to this: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-VTQgI5WwH6s.html
hey uh i have a silly question can you make a video on how to make random animation play from an animation array with different animation clips for it to pick from? and the result of whatever gets picked via random is the animation that plays? sorry if the wording sounds confusing i just havent found much on this. all this being done via a button press from a object in the world?
@@greyfox6262 you would want to use the node 'animator, play' to play a particular animation on an animator, by name. The all you need to do is use the method shown in this video, but with a string[ ] with all the possible animation names, get the random name from the array, and then plug it into an animator, play node Hope that helps ^^
@@RainbowiaPS3 bacause if they added a node for every combination of things you want to do, then there would be so many nodes that it would take ages to search through. Sure that might be better in this particular case, but depending on what you are doing, you can modify any of the values to fit. You can add a bonus offset to the vector position value to offset it's location, replace the rotation with its own to create a compass of sorts, replace the rotation with one that points it towards a particular object, or just replace both values with a world object's pos & rot to teleport the object. The more powerful the system the more modular it needs to be. The cost however, is that it makes the basics a little bit more tedious (would be nice if they provided a bunch of general scripts though)
This is very useful but how would I need to change things to make a set of buttons, each button turns one specific set of objects active, and the other sets deactivated? ie: Press Button 1 to activate scene 1's objects, but deactivate scenes 2 and 3. Press scene 2's button to activate scene 2's objects, but deactivate scenes 1 and 3, etc? I've gotten this working locally, but I'm struggling to figure out how to network it so everyone, including late joiners, see the change.
You either forgot to add a ui shape component to the canvas, or you made it on a layer the player can't interact with (like ui). I recommend using the walk through layer
select your 'child' object in the hierarchy. Then click and drag it on top of the object you want to make it a parent of (in the hierarchy) hope that helps ^^
@@neojenshi4055 this is an outdated video before the vrchat companion app was made. I recommend using VCC to install and manage your sdk (auto installs for all new projects too, which is nice) The only reason you wouldn't use the companion app us for custom sdks; to which I can neither help nor recommend
@@vizra8848 it shouldn't have.. Usually when vrchat breaks something, it's best to just post errors in the canny so they can fix it on their end. However if anything comes up and there is a fix, then I may make a video
I know this video is old, but do you know how you could set the objects momentum to zero as well upon respawning? I'm trying to make a button that resets all ten pins in a bowling lane when pressed. I got the button to reset the position of the pins, but the problem is that most of the time they're still rolling when the button is pressed, so they tip over as soon as they reset.
Add a public rigidbody variable to the script, and then add a 'rigidbody, set velocity' and a 'rigidbody, set angular velocity' node. For each node, give it the public rigidbody variable, and a 'vector3, zero' node. Then plug the arrow from the 'vrcObjectSync, respawn' node into the first node, and then the arrow from the first node into the second node. Hope that helps ^^
This video also shows how to make each script networked... unless I've missed your question? Note: for each script, I show/ test that it works in game, and then make an addition to it
I have a question here. How do you make animation, because when video start, I saw animation and animator already set up there. I wanna make semaphore or traffic light that if I press a button, the light and countdown starts play.
@@theraiden9631 there are unity tutorials that cover this in depth, but if you want one from me specifically, then I recommend looking at any of my door tutorials. Just note, and animation can modify any component variable; not just the objects position or rotation
Thanks so much for another great tutorial! I am looking for a tutorial where a set of game objects are randomly assigned/dropped to predetermined spots across a map at the start of a game---do you happen to have a tutorial or know of one? Thanks much!
id like to ask, i did the camera layers as stated here, but each time i launch it, it just never pops up? it seems like the culling mask on the player camera affects what can be seen..
@@Hex2906 It is done a little differently, as there is no 'play' function you play, but instead a variable (value) you change on the obj. I have a video all about toggling one/ multiple objects with udon, and how to sync it. I recommend watching that video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-19HMJaHGtqw.html I also did a more recent video, talking about how you can toggle basically anything in udon. From what I remember, that one didn't cover the syncing side of it, but it is a great video for explaining how I know what nodes to use in udon, so if you want to learn to make your own udon code, I recommend watching that video. Note: The start only shows toggling lights and light settings (I show gameobjects later), but do listen in, as it teaches the 'why' so you can figure out how to toggle anything yourself (and then I show more examples) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-fuDK8fYNuh0.html
I've been looking for a tutorial just like this and I'm so glad to have finally found it! My only question is how do you set up networking so that it syncs for all players? For a bit of context, I'm trying to make it so players can pick up a gem and place it in a slot to solve a puzzle. I only needed to get as far as Scripting the Lock V1 for it to work but I don't know how to set up networking for this kind of event.
@@PlayerBush001I do see there’s a section near the end where you’re testing the networking but I can’t find where you’re coding that in the video. Can you pinpoint exactly where it is?
@@AaronMoonfang Re-reading your question, you simply need to add an object sync to the object. Then everyone will see it enter the spot, and everyone will do the logic to unlock it
Not sure if you're still responding to comments here, but I have a question; For my world, I have multiple audio sources, as the music changes once you walk into a room. I was wondering, how would I make a toggle to turn off all of the music at once?
Depends on how you are doing the music, but you would either want use an audiosource[] or an audioclip[]. If the music has no specialization on it (plays in your ears, instead of from an object/point in the world), then I would just have 1 audioSource, and then change the clip of the audioSource to the new music track. For this, I would have 'music manager' script, with a public audioclip array on it; containing all the music tracks. Also have the target audioSource, and a public int that keeps track of what music track is playing. With those variables, create a custom event, that when called, gets the current clip in the array, changes the clip on the audioSource, and makes it play. (a similar script is shown in this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-dmtftR4TefI.htmlsi=gMiOLuXgkd3V63ym (though i randomized the int in the 'audioSource, get' node)) Then, create some trigger objects around your map, and 'event, on player trigger enter' --> 'playerapi, is local' --> branch -(true)->, get it to change the int on the 'music manger' script and then call the custom event. However, if you are instead making the music play from a point in the world, then things are a little more annoying. If you only have 1 audioSource per area, then you could just have an audioSource[ ], and cycle through all the audioSources; making all but your target one play 'audioSource, stop' and the target one play 'audioSource, play'. Alternatively, you could also just have them set to 'play on awake', and then cycle through a gameobject[ ], and toggle off the object/ parent objects with 'gameobject, set active' Hope this helps ^^
This answered a long standing question for me: How the heck do people know what nodes to look for? Thanks for the explanation of how nodes are determined!
hey, that's awesome! Even if you weren't successful, I always love hearing people giving udon a go ^^ It took me multiple discoveries to get the code I showed here, so I'm glad I was able to help ^^
Hey here's something I want to figure out, how to unlock areas for individual players with only admins being able to allow them past an invisible barrier for allowing them into an area
this helps me a lot, thanks, but how do I make it so that only the instance owner can see the camera, but other random players can activate or deactivate the camera with a button?
@@NormalBen20 have the camera be a child of the player follower script. Then on the script, have two variables: a gameobject called 'camera' and a bool called 'is active' Create a custom event called 'updateCamActive'. Put a 'networked, isInstanceOwner'(?) bool and the 'isActive' variable into a 'boolean, conditional or' node; then put that node into a 'gameobject, set active' node. For that gameobject, set active node, plug our event into the arrow slot, and our camera variable into the instance slot. Now we have an event to call, we want to create the events: 'event, on enable' & 'event, on ownershipChanged', and plug them into an 'udonBehaviour, send custom event (updateCamActive)' node. Then create a custom event called 'toggleIsActive'. This event will be what you call from a button in your world to toggle the camera on and off. For this, you simply need to create the nodes: 'isActive' --> 'boolean, unary negation' --> 'set isActive'; to toggle the bool. Then plug the arrow from our toggle is active event into our 'set is active' node, and then plug it into an 'udonBehaviour, send custom event (updateCamActive)' node. So hopefully that helps. If you need any help, feel free to join the discord and ask there; as there you'll be able to add pictures that help us know where you went wrong. Good luck ^^
Here, I made a video on my second channel on how to do this (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-l27oyhEuyIE.html). I did forget to include the animation part, so be sure to check the description where I explain how ^^
@@damienk777 all udon scripts need to be on an object, as udon doesn't have access to a players files for security reasons. You'll need to have both scripts on an object/s
Sure, though you do need to get creative, as you are unable to tell a different player to teleport; only to tell them to play an event that tells them to teleport. In my 'falling platforms world', I just turned on a box collider for everyone, and added a script to that collider that teleported anyone 'onPlayerTriggerEnter' so they would teleport themselves. I then got them to pick a random location from a transform[ ], so they would spawn at different locations. People sometimes spawned at the same location due to it being fully random, but that wasn't a problem for my world. If that's not okay for your project, you'll need a more complicated script..
@@PlayerBush001 I think i will lol. if you ever knew the XcDisc world im trying to create my own version of it cause it was taken down recently. however i have 0 world unity knowledge 🥲
can you do one about a button that uses contact senders and receivers? im trying to experiment with that for controlling parts on an avatar and possibly a vrchat map.
@@cyberstar251 is that exposed in udon? Never touched the later avatar stuff, or seen it referenced in worlds. Might be fun to look at, but Id need to see documentation for it 🤔
@akiraakiraakiraakira watch the second half of the video to see how I would network it. That version will update for latecomers ^^ The general idea is to use a synced bool instead of a networked events, as a networked event is a one and done call, instead of being stored
do you have a tutorial for contact sender/receiver buttons or triggers for something like a light switch? i've been struggling with using contacts for a project.
@@cyberstar251 aren't contacts an avatar thing? If instead you are referring to triggers/ on collision events, then while I don't have a specific tutorial, I do cover them in passing. For an example, have a look at my multiple key video, where each coin tells a manager script that they have been used ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-hsnBrLQizDo.html Or you could also have a look at my two fundemental videos, showing how to send an event, and get a program variable from another script (the same method would work for setting it too, just use 'set program variable' instead) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-0yMwbl25k3c.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-HERcbs636Xo.html If instead your referring to an asset in particular, or udon triggers, I can't really help with that ^^'
And I thought I would never understand udon. This helped me a whole lot! Thank-you so much! I just made a simple button for inside of my world just for laughs and now it's way better!
@@Cyber108 Glad to hear it! There's plenty more example scripts on the channel, so feel free to look around ^^ If you fancy leaning the fundementals, have a look at the two videos with 'udon 101' in their name, as there I explain in more detail how the nodes work ^^
Hum i watched it again, and i have a question, if we have multiple GO with the same variable name, does it still work? But also can we get a specific one?
No two variables can be named the same on the same graph. If you try that, it will add a _1 to the end of the name. For this node, it takes a specific udon behaviour, so therefore there can never be two variables of the same name. Where I think you might be confused, is if you have multiple udon behaviours on an object. This is generally not recommended, and should normally be all part of the same script. If how ever you have 2 scripts, you might be confused by a unity shortcut. You see, when you drag and drop an object into a public variable slot, it chooses the first udon behaviour it sees. It does not save the gameobject at all. Therefore, the only way to get this script to call the second udon script, is to create two inspector windows; select the first object and lock the tab; then click on the other object. Now you should see the inspector for both windows, you can now drag and drop the exact component into the script. Hope that somewhat explains it ^^'
Well, i just want: When an object collide with the trigger, it will change the state of the other object by the first object got triggered (like set variable "state" to 1)
@@normioffi If you only have 1 script on that object, it shouldn't be a problem right? Or perhaps I'm reading this wrong. Perhaps you want to get the udon behaviour of the object that collided with your object, which can be done with the the node 'collider, (type) get component (type udonbehaviour)'. Here's an example script you can paste into your graph: application/vnd.unity.graphview.elements AM2Wy27jNhSGXyXgWhR4vwTIygkGRotmMJN4UwQGSR0ZamUp0CWt4cmTddFH6iuUsuM0towZIZgBam/Em/ifj//h0T9//b1FT67sAV3+ukV5X5a/uHVsoJsnqLrlbXXXFKsVNDdVBw1KUF9kcTDPDAvBGqydACw8MGy9JdhkWfDUGmUA4uTHui26oq7Q5Rb9iS6xVDqV1hrJJZWKyQRtYi8lPCXxp+LDvv85QVWdwf38uo2yHhKUl/UfLy0EUhvKM4558BoLYgB7LwymnEPQwueOCPSwf8NiiGz3jufkKLr7qug2N9WqqGBWl2WRQZMulx+gm9Xrx7oaQl9+3rQdrO82j7BcHs1/mfFKQ3oCxlAS48sdFtww7JTKsAahnXbKW6HP0GDSpirGbbX6DwajqYl9whhm6CmJSdy/kLgXiU9aBI2dIQELFzx2IWNYahUEzXKtiI8Tj9GeQtuifgj71v8GoVvsTbJFRdV2rgowv0aXJOpru6aoVi/DCA2g37Ps9IR23BefZvdZXUXk67qaDxbMXYB2PnTuDPoJAhRPb5w5JfBzzhQytdGZWltmldH709DqyK5fs+W3DDdvl3EsSjwInWTjsVDBjvxxyCA2CLVaSiMt16e2mWLQkRsQ5RayYDymPkSzZTZgyxiJMrl3WkguGIwS7fsc/uRz3yftx6ZeNW69cE3hfAmH1P282+XQ2kt65W+YNSQXOaaWUyw0ybDNncKSAANGZEasG/OnTJ3jb1NBCBVKGPFu+gkKUphcQ7SEY3EiE1ESCzLeCTpXkDnPnPl/J+2sjguO6L/ynhLcGb9TYVIerU0YH9DueO8KxgnkH0BlH0a6jyO5WLehbsrCJxcLaNoo8UqkZPgnF7O+7PoGrirou8aVycXH3pdF+Ak2d/XvUF15rZ0MUkWrCSDGfvlwO2Y3uiEm5d+IWIQ0riqU0KHE0rhcEz6uK1OSYXxBZIJyRgXHhg9HqjLA1jiDg5PS5zxuKP0PuiDe1ONr8P0q3gM/1yepfmgt6jdQJ2keQT3/4aJ2tZqSWHf5uWr9Lqrfi9fD878=