Тёмный

Create Object Respawner Script - Udon / VRChat SDK3.0 

PlayerBush001
Подписаться 3,4 тыс.
Просмотров 2,6 тыс.
50% 1

Опубликовано:

 

18 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 33   
@PlayerBush001
@PlayerBush001 2 года назад
Video Correction! : onTriggerEnter DOES play if both objects are triggers. 'onTriggerEnter' plays when there is one or more triggers that enter the trigger/ collider (provided it has a rigidBody), while 'onCollisionEnter' plays if one or more colliders enter a trigger/collider (provided it has a rigidBody). Sorry for the mistake, but big thanks to Vowgan for pointing this out. Be sure to check out his video covering how to respawn multiple objects at once, if your interested: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-cAQWVq7o5x0.html
@josephlucas502
@josephlucas502 8 месяцев назад
Thank you so much for all your tutorial videos. I keep finding myself referencing these videos while learning to world build and they are invaluable
@PlayerBush001
@PlayerBush001 8 месяцев назад
Glad to hear! I've tried to make the videos I would have love to have when starting out, so Im glad you're finding them to help with just that XD
@KattoDoggo
@KattoDoggo 2 года назад
While I don't think I'll be making a trash can any time soon, this does give me some tools and ideas. Thanks for this and all your other tutorials! They have been very helpful!
@PlayerBush001
@PlayerBush001 2 года назад
Your welcome, glad your finding them helpful ^^
@superjare23
@superjare23 2 года назад
Question for ya, I'm wanting to make a teleportation script where it would need an item to be placed on another block for the teleportation button to work as kind of a "secret" teleporter. Did you by chance offer scripting services for funds in return or would you think you'd do a tutorial on this in the future? Thanks for your tutorials! I do tutorials myself but on whole other topics! :)
@PlayerBush001
@PlayerBush001 2 года назад
Glad your liking them! ^^ I have it all setup, but I don't currently do commissions. I do help people in vrchat's official discord on and off though. As for your question, to do so, first you want to follow my player teleport video. Then once you have your button, you simply want to set it to be active when the object is in the target position. So on the object that's the target location, you would want to do the name check I did at the end of this video, But instead of making it play a 'objectSync, respawn' node, you would want to replace it with a 'gameObject, set active' node; with the target object being the button to teleport the player. Hope that helps ^^
@superjare23
@superjare23 2 года назад
@@PlayerBush001 Thanks! Will try it out today! My friends have been asking me to implement a "Secret TP system"!
@swagbb8651
@swagbb8651 2 года назад
Question, how can I make it so a pickup object can not be taken out of a room or be taken with you when a player respawns.
@PlayerBush001
@PlayerBush001 2 года назад
Sorry for the late reply.. To do so, you would want to use the 'event, onTriggerExit', and if so, get it to run a 'pickup, drop' and a 'objectSync, respawn' nodes. That being said, you will need to do checks to make sure it is exiting the correct trigger, and not just a random button in the scene. Two methods I can think of off the top of my head, would be either to check the name of the objects, or making the triggers on a different layer that only interacts with itself. You would also need to check 'event, onPlayerRespawn', and that it wasn't the owner of the object. As if so, they need to respawn the object. Been mulling over the best/ simplist way of doing this, and I think this is how I would go about it, at least generally. There is also the more fancy way of seeing how far out the object is, and teleporting the player that amount. Makes it feel like the object can't be pulled out, instead of it just respawning. Hope this helps ^^
@itzmk4764
@itzmk4764 Год назад
I have 2 questions. 1. Is there a way to make a script for edible objects for both pc and Quest compatible? 2. Is there a way to make the items being eaten respawn where they came from instead of spawning at spawn? An example is a candy bar in a box. I want the candy bar to be in a box and I take it out to eat, but when eaten it respawns back into the box.
@samaaaron
@samaaaron Год назад
I am VERY new to UDON and Thank you so much! Very useful. My question is, how to have a game object respawn when it reaches a certain distance from it's spawn point, or below a certain position.y? Like if I throw something very far away or drop it off the end of the world, how to have it respawn?
@PlayerBush001
@PlayerBush001 Год назад
No worries, glad you liked it ^^ As for respawn the object bellow a certain height, there are a couple of ways of doing it. First up, if the object has an 'object sync' component on it, it should (afaik) respawn when it gets bellow the players respawn height. As for other methods, you could always check if the objects y height is above a certain height with: Transform, Position --> vector3, get y --> float, greater than (target height) To get a bool saying if it is higher than a particular height. But you will run into issues as to when it should do the check. You could do it with 'event, update', but that is just inefficient and a waste of resources. Honestly, I would just use the script I did here, but with a really large box collider; as I did for my throwing rocks in my 'house on the water' map Hope that helps ^^
@necatron73
@necatron73 2 года назад
Ive sort of used the walk into area mirror script and combined with the teleport script as a boundary box to stop players from cliping through walls on pc to get to hidden areas. Its a bit cumbersome and tends to teleport everyone back to spawn. Im guessing as its because its networked.
@PlayerBush001
@PlayerBush001 2 года назад
OnPlayerTriggerEnter plays whenever ANY player walks into a trigger; not just the local player. So, while it's not technically networked, if you don't have a 'playerApi, isLocal' check (that I believe I used in that video), it will appear networked Hope that helps ^^
@mrkesler1986
@mrkesler1986 2 года назад
Can you share a video to make a key door like when you put an object on a block, door open or when you click on a button plz?:o I wanted to create a horror map and i just started... Thx for all your video, really helpful 🤘
@PlayerBush001
@PlayerBush001 2 года назад
Glad your liking the videos ^^ This has been something requested for a while now, and I recently tested making some stuff for a video cover how to do just this (the key version). Can't promise anything at this point, but there's at least two videos ahead of it
@LuvKayArt
@LuvKayArt 2 года назад
Do you think you could possibly make a tutorial on spawning duplicates of an object? If an example is needed, when someone clicks something, a duplicate of what they've clicked appears! (Sorry if that was worded weird-)
@PlayerBush001
@PlayerBush001 2 года назад
I don't mind the weird wording, but I am a little lost as to the question.. Do you want to have (for example) an umbrella hanging up, and then if you click on that umbrella, it will spawn in one in front of it that you can pickup?
@LuvKayArt
@LuvKayArt 2 года назад
@@PlayerBush001 yep! That defines it pretty much
@PlayerBush001
@PlayerBush001 2 года назад
okay, so to break down the problem, you want to spawn in an object when you click a button. The only difference is that that button also looks like the spawned object. Now, spawning in objects in vrchat is a bit of a pain. If you don't want it to be networked (aka, only you can see the spawned object), you can spawn in a new object with instantiate. If however (and more likely) you want the object to be seen by all, then you will need to have that object in the scene when you make the world; just that it's toggled off. Then all you have to do is toggle it on when you click the button, and move it to the desired location. Now, the best way of doing that is with an object pool. The object pool will contain a bunch of summonable objects, and then you just need it to grab one of those objects when you click on the button. I recently made a video covering how to create and use an object pool to create a deck of cards (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-s96fkF2MsaY.html). Admittedly, this is a slightly advanced topic, however it should contain everything you need to make what your after. You would just need to change the summon button from a deck, to the object you want to use as your button, with a mesh collider on it. Just be aware that there is currently a bug in it pointed out by Caymon D that occurs sometimes when the pool is empty, that can cause vrchat to crash. I am planning a followup video talking about fixes, but it will take some time Hope this helps ^^
@bhoffman1967
@bhoffman1967 Год назад
Problem: If you pickup the plant and walk into the trigger holding the plant instead of throwing it in, results in weird behavior. Forcing the player to Drop the plant would work I think... just don't know how to Udon that.
@PlayerBush001
@PlayerBush001 Год назад
Certainly (thought I did that in this tutorial... But perhaps not. Been a while) To forcefully drop an object, you will want to use the node 'pickup, drop'; which will force the local player to drop the pickup if they are holding it. However, that node needs to know the pickup to drop. This can be done either with a public vrc pickup variable; or it can be done with a 'gameobject, get component' node, that will allow you to get a component from a gameobject. We will alao need to tell it get the pickup componet from that obj Hope that helps ^^
@bhoffman1967
@bhoffman1967 Год назад
Yes, that is what I think I did. VRCPickup.GetGameObject and VRCPickup.GetType both flowing into a GameObject.GetComponent node flowing into a VRCPickup.Drop node after the Respawn. Sadly, that disables the respawn and doesn't force the drop to happen.
@PlayerBush001
@PlayerBush001 Год назад
@bhoffman1967 yea... Those aren't the right nodes, but your had the right idea. The script probably crashed; hense why it didn't respawn it. You want to get the gameobject from the 'collider, get gameobject', as we want to get the gameobject that collided with the trigger (same as how we got the object sync). You used the node 'gameobject, get pickup', which is used if you have a pickup variable and want to get the gameobject it's attached to. Also, you don't want to use a 'pickup, get type' node. Instead, you want to use a 'type pickup' node instead. This one trips up a lot of newcomers, but all variable types come this way, with the 'type' coming first (I don't even know what 'pickup, get type' is even used for... Though I also haven't gone looking). I'm not at my computer rn to check, but it might be found under 'vrc type, pickup' instead
@bhoffman1967
@bhoffman1967 Год назад
The VRCPickup.Drop only has two possible paths (Void / VRCPlayerAPI). Each of those paths have only so many possible valid noodles. I feel like I've tried all possible combos.
@PlayerBush001
@PlayerBush001 Год назад
@@bhoffman1967 copy and paste this into your udongraph: application/vnd.unity.graphview.elements AM2Wy27bRhSG32XWGmKuZ2a0jG0ERoAkiBNtCoOYGwUmMimIVFLB9ZN10UfqK/TQshVHEhSitYtsBIrkDOf/zn8uf//51y356hfrTKa/3ZJqvVi89Tf4h1x25cwv6kQmZI2/U6IqcNkrQyvhJVVgPPVJWppSDNYYwXKU+PKy7eq+bhsyvSW/kylXrjBgGYBiIPSEbMiUCmYLKYBzZqWzShq4m5CmTfnT5XmHByGRB51ZiBSXJqock9QFIajOQVnHtM1e/8HI9YRUi/bb4yo8hQItOc2hilTlWNEQACirnGTZVzzIalgzfGk2aO7uRa+but+8C59z7GdbErekbrreNzFfnpMpw8N1/apu5g+PCbm7vpucpiWSczL7RMEkVKCDpFbLQEVIUAWmXMXNIS08fOGU4NKC4dZscUk3wMIllinAm3useHKeJaapNRm/xJKlNrJAs60cB5Vz0HDIKpmgmVWWGm0FVZxrGipgVEkbK8cwnIy9EKtPwx4Xzbxu8mu8s92tKMvXuT9rb5Ztk5u+LK82XZ9vPm6WuSyfrNi9sSM9Rv8haeHsQJpxAMb1ozM5Fz8acx+2t1FJZTn1tsKPVSlS55Qa3GmgigJ0lAh7QpjNEgw+scYpfNFFGqJGG0NGHyQTOcS9mDwP7cnzBOke/OzD2dX5G7lj3uGN7b5XmybuIjBK60EElDwSgJ9VhtPE9kWcPj9a7kPulv5b8+i2Wfskg0dlyIEqwwFlcesU5vKDKAunTfWvMvjFc/OsXWBByyvENM99Od+l6g/5+D2Dd+DG5MghOIoWKowznDv+vVVwAQV3GrgBo41FonvsZHQ52Jgp+OwwNsZgndVAcxI2QTIpR///s3uOujamBx7BaETBtHFWPnht23G5VAXXggMDde/M/Y47urAlYyCAdkOTtVQZb2mwKlLGY0roWO9DeiHgz1/aXvku41X5vo5f1ssnqf9zjUfQC6ePshfuJPv/XtO2x0erna/a5dFiNmo0OlAkhSkAdRgpcCixO0EGa9xglq2c/ZQcObxNyP5MMmpm+qWsdPF1yOl3zcdVPZ/n1UXT59WO+ZjSdCyBj3SQ+4lZOInm4ttuecpC40b1Q6Nd3/0D
@voskorbia
@voskorbia 2 года назад
uWu
@PlayerBush001
@PlayerBush001 2 года назад
uWu
@superjare23
@superjare23 2 года назад
@@PlayerBush001 But this wasn't uploaded that long ago ;-;
@PlayerBush001
@PlayerBush001 2 года назад
@@superjare23 Haha! Friend privilege exposed! ^^
Далее
Create an Automatic Door - Udon / VRChat SDK3.0
17:00
КОСПЛЕЙ НА СЭНДИ ИЗ СПАНЧБОБА
00:57
LOL! I mean... Hmmmmmmm...
8:23
Просмотров 867 тыс.
I Made A Difficult Game About Climbing
15:04
Просмотров 2,1 млн
Respawn Objects | VRChat Udon Tutorial
13:41
Просмотров 3,6 тыс.
So what's up with that LEGO Island pre-alpha?
6:23
Просмотров 205 тыс.
10 Minutes vs. 10 Years of Animation
19:29
Просмотров 961 тыс.