How to Change the Player's Respawn Point - Udon / VRChat SDK3.0

Sdílet
Vložit
  • čas přidán 8. 09. 2024

Komentáře • 55

  • @PlayerBush001
    @PlayerBush001  Před 2 lety +4

    Midway in the video, I mention that 'there is currently no way to respawn the player'. Well, now there is! In the latest update, they added 'playerapi.respawn',
    so now we no longer have to teleport the player below the map!

    • @haeslet
      @haeslet Před rokem

      Would you make a video on respawning the player on collision enter please it would be very helpful.

    • @PlayerBush001
      @PlayerBush001  Před rokem

      Hmmm... maybe. Can confirm it will be part of an up coming video though.
      That being said, all you would have to do is create the script seen at 5:48, and just replace the 'playerApi, teleportTo' node with a 'playerApi, respawn' node. Plug everything into exactly the same way, and it should work perfectly.
      That being said, the script shown will work as is; just that it's a little bit of a hacky way of doing it.
      Hope that helps ^^

    • @noobio5510
      @noobio5510 Před rokem

      @@PlayerBush001 I tried doing this, and the teleport option, the death block doesn't work for me

    • @PlayerBush001
      @PlayerBush001  Před rokem

      @@noobio5510 Make sure you have a collider set to 'istrigger' on your object; otherwise no logic can happen. If you still don't see it working correctly, I recommend having a look at this video (czcams.com/video/WSDWzINS0PE/video.html) to figure out how to debug your code

    • @noobio5510
      @noobio5510 Před rokem

      ​@@PlayerBush001 I figured it out, though it doesn't work with Cyan Emru, but it does work in game vrchat, it came out with this error:
      Exception Message:
      An exception occurred during EXTERN to 'VRCSDKBaseVRCPlayerApi.__Respawn__SystemVoid'.
      Object reference not set to an instance of an object

  • @auxiefox
    @auxiefox Před 2 lety +5

    please PLEASE keep making these videos of random vrchat udon/ unity tutorials, they're so good, i can never find exactly what i need when searching on youtube i'm glad i came across you

    • @PlayerBush001
      @PlayerBush001  Před 2 lety +2

      Glad you found them helpful ^^
      More to come!

  • @HarmonyIsDead
    @HarmonyIsDead Před 2 lety +1

    Wow i didnt even know about the Ctrl + Shift + F thing and i have been using unity for 3 years.
    Another great tutorial!

    • @PlayerBush001
      @PlayerBush001  Před 2 lety +2

      I probably rely on it too much tbh, but its super helpful!
      Another useful one is shift-f, that makes your scene camera follow the object as it moves around the scene. You can also hold it while flying to orbit around an object, as if you were spamming f.

    • @HarmonyIsDead
      @HarmonyIsDead Před 2 lety

      @@PlayerBush001 Oh wow, didnt know about that one either. that's gonna help alot!

    • @PlayerBush001
      @PlayerBush001  Před 2 lety +1

      ^^

  • @EliteCraftedGaming
    @EliteCraftedGaming Před 2 lety +1

    Spot on, to the point, nice and simple! Thanks for this great tutorial!

  • @rodrigopower11
    @rodrigopower11 Před 2 lety +1

    So this is how we do different spawn points, so cool! Amazing tutorial once again!

  • @user-du9hf2wu4j
    @user-du9hf2wu4j Před 2 lety +1

    It's a function that I've been looking for. Thank you so much for uploading the video.

    • @PlayerBush001
      @PlayerBush001  Před 2 lety +1

      Was stumped on how to do it myself for the longest while, so figured I should share. Glad you found it useful! ^^

  • @user-xy8tw4sr1o
    @user-xy8tw4sr1o Před 7 měsíci

    Thanks for another great video! I have a problem I can't figure out. I have one single spawn location setup in VRCWorld and it's set to "First." The problem is when I launch the world in using VR-mode, players spawn exactly where VRCWorld directs them---BUT, if I launch the world in Desktop mode, players spawn at a different place on the game map when entering the world. Respawing in both cases works fine. I cannot understand why Desktop users spawn to a different location (nothing is even in the place they are spawning to). Any thoughts? Thanks so much!

    • @PlayerBush001
      @PlayerBush001  Před 7 měsíci

      Wow, can't say I've run into that glitch before. My only advice would be to check on anything that has a script that uses 'playerApi, isUserInVR', as perhaps there is a problem with it. Could be a Rando collider that should be set to isTrigger, or perhaps an add velocity feature that isn't set to 0 when the game begins. These are all unlikely, but your problem is strange too...

    • @user-xy8tw4sr1o
      @user-xy8tw4sr1o Před 7 měsíci

      @@PlayerBush001 Thanks so much for taking the time to reply!

  • @taco_boi
    @taco_boi Před 5 měsíci

    How do you make it so you spawn in a spawn room and then enter a different room and once you enter that room and respawn it ONLY respawns you in THAT room that you just entered?

    • @PlayerBush001
      @PlayerBush001  Před 5 měsíci

      by adding a checkpoint in that location, like this video shows? sorry if I didn't follow your question.
      for clarity, in this video, when you go past a checkpoint, it changes the respawn location for your player. So if you get a checkpoint, and then click the respawn button (or fall out of the map), you will respawn at that checkpoint's new location

    • @taco_boi
      @taco_boi Před 5 měsíci

      @@PlayerBush001 ohhh, okay, I think I got it

  • @MrPalps
    @MrPalps Před 11 měsíci +1

    This doesn't make sense, you said to set the empty game obj as the new spawn, and then match it to the current main spawn? Yet when you demonstrate it in play mode the checkpoint respawns you at a different location, and If I try to move the respawn point we made to the checkpoint, I just start at the checkpoint because it's now set as the new main spawn.

    • @PlayerBush001
      @PlayerBush001  Před 11 měsíci

      The VRCworld has a scene descriptor on it. On that scene discriptor, you can say what object you want to be the respawn point. I made an empty (let's call it spawnObj), and made that the spawn point. Now, if we were to playtest this, we should see us spawn at its location. We can also move it around mid-game, and it will change where we spawn.
      Now the code for the checkpoints is rather simple. When the player enters the trigger, the checkpoint needs to move the spawnObj, to a new location. The easiest way of doing this, is to create an empty gameobject on the checkpoint, and grab it's position and rotation values, and set the spawnObjs pos and rot to match. If spawnObj has the same position and rotation, then the player will spawn at the same location as the checkpoints empty gameobject.
      Hope that helps clear it up ^^

    • @MrPalps
      @MrPalps Před 11 měsíci

      @@PlayerBush001 I'm not sure I understand but I did get it to work, but is there a way to create multiple checkpoints?

    • @MrPalps
      @MrPalps Před 11 měsíci +1

      Oh, never mind, disregard that, figured that out too lol.

  • @taco_boi
    @taco_boi Před 5 měsíci

    I've got another question 😅
    I noticed that if I spawn in a remote player it will spawn NOT in the original room, but rather on the new spawn (The room that you enter) Is there any way to make the object that you spawn on local?

    • @PlayerBush001
      @PlayerBush001  Před 5 měsíci +1

      Any new player will spawn at the original spawn location. The only reason the remote player spawns at the new location, is because you only have 1 unity instance open. To properly test networking stuff, you will need to build and test with 2 players
      If they still spawn at the new location, test and see that the 'onPlayerTriggerEnter' has a 'playerapi, is local' check on it (show that somewhere in this video)
      If you don't know how to build and test with 2 players, well it's a bit weird since easy anti cheat was added. First open 1 normally, then open another with last build. You will need to checkmark something in settings too. I show this in most videos that do networking since easy anti cheat was added a year or 2 ago

    • @taco_boi
      @taco_boi Před 5 měsíci

      @@PlayerBush001 oh okay

    • @taco_boi
      @taco_boi Před 5 měsíci

      @PlayerBush001 I have a new problem, it just completely doesn't work on vr, it only works in the unity editor for me, no matter what I do it never works on the vr, it just takes me instantly into the room after spawn

    • @PlayerBush001
      @PlayerBush001  Před 5 měsíci

      @@taco_boiand this is why we test in game ^^'
      I would need to look at what you've done, but if I were to hazard a guess; when the player loads in, they temporarily get placed at 0,0,0 before teleporting to the new location. Perhaps that is triggering the respawn
      Honestly, I would instead use the node 'event, onPlayerRespawn' and get that event to change the spawn location; as that will mean the player will get 1 respawn (being them spawning into the world) before it changes. Have a go at that and see if it works for you. Just make sure to do a 'playerapi, is local' check

    • @taco_boi
      @taco_boi Před 5 měsíci

      @PlayerBush001 okay, so I got what you mean, but the problem still continues, I'm really stumped rn and I kind of want to finish this project quickly 😅

  • @iampg42
    @iampg42 Před rokem +1

    What if someone hits the respawn button?

    • @PlayerBush001
      @PlayerBush001  Před rokem

      This changes the respawn point for the world (locally), so hitting the menu respawn button will teleport you to the new respawn point, instead of the original

  • @taco_boi
    @taco_boi Před 5 měsíci

    Hey, uh, you never answered my question, I've been stuck on this for a while now: "okay, so I got what you mean, but the problem still continues, I'm really stumped rn and I kind of want to finish this project quickly" "Quickly" kind of went out the drain

    • @PlayerBush001
      @PlayerBush001  Před 4 měsíci

      You've asked two questions here, and I've answered both. Given your uncertainty with your reply on one of them, I assume you're referring to the question on 'how to make the player respawn in a different location the second time'
      The could would look something like:
      application/vnd.unity.graphview.elements AO1Y21LcRhD9FUrPO1tzv1DlBxs7icuJTcDePMTU1lxajhIhUZLWmIC/LA/5pPxCemFZCJIT2QYKUtTuw6wuO93nzOk+M3/98edx9t6XC8g2fz7O8kVZvvT7+COb+abwoYT57lHbwf6Tui7BV9kkWxQJb/skg3A0Epu0JFIkRRznQHKfJ+6siZJpfPigbouuqKts8zj7kG0STpWdCmo0M8waNcmO8KLldEo/TrKqTvDm+d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2OWQd85iVwFC+jlghM4u2OaBC81ejPhRKA0BxeuxTZ9YW25RNh0ReJk4/LFrbqBH+q0KOGiStKxVbLCtXVy/Db78BbnxhfeZkfr0e9no4/XEPjFUrvd2HF0uM7iqpi2aoz/E5tMi7q2jHoShMRmEQw28QCBgPGUcypUUq6/+JWgU6YpN1bgM+sC7OjUMqO0csw4bY2+tT56g2c6V9HcHfIfo8TVg3H4bAJRFMootIXcGCGF7R/7jWHttFTcL+dyo8b+rp7N7eHnbw==
      but perhaps 'event, onPlayerRespawn' gets called before the player actually spawns. For that, you would need another bool, so it would be:
      application/vnd.unity.graphview.elements AO1Z21IbRxD9FWqfNaq5zzRVfrCxk7ic2ARs5SGmqLnaSsQupZWMCfaX5SGflF9IS+hCpDVZE0GAUOJhNbva6enTp0938+fvf5wVH9xgnIrtn8+KPB4MXroj/FL03LDv/CAd7p/Wo3T0pKoGyZVFpxj3I95WLgQPxhGXkidSOUm8yPgVwIMVNnHg+PBxVfdH/aosts+Kj8U2sVx1haVcAuVCCqM6xSkuS2q6lnNFwWilufrcKcoqpjfPn9ZoV4EvWv4ddIo8qE5m9w7On+xNjlBPzzAu+6PTV/6XFEa984OdFf2yHrkypOdPi22KL69Hw375bna7KD53rvKzc8d096eLna2jOlTDQd93tnppWOOZH8kunXw6WzvjwWg8TI/KNB4N3aCztTv2g354kU5fV7+m8pE3xqmgNAMhE7Xw6b2r94/dSZniv7NthtpmjfvGDep0P+26DizLqkSrDiZ2NdHrzcTWZ+W7fpleD11Z52p4tGCZ4S4aFxPxSnEiGQ3ERxcJt4pSn4zQ2jWwjFsrutoasJZbxmckY5w/sOwiMi/TyZRlu1V9C8P59XD8wLIbYVmQwKIGR4QzEbVMcmQZl8QKDyzlxHOMDyy7KjK9vZ2f8GW3UckeKLZBijXXiS5KLwB1y0YtiRRREeA8kexy5GBNkEw/cOuqkHzn6jfH0Y1SnArZ/Yzl22rXzXHsCUpWeL/UKyM9BGoIc9ESGQL2Xtla4kPggTrGRWzqvY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PR7wrhJYGWBZMF2263MEi0e2jDpssyXqljdYW3hsvZNxlHMqVFRwB+cIrf5r8H+eI7TBfT3MrKBdZY3iUjLsbuapCuMMQFG0SE05p+/jNGGlcWw5nl5xIMdO2YDhf+cpmSX7L4/Qk3OCqsxIiAnhMpAxP1hPYggMXNYQQa5XMrh/q/LttgPyVa1jC0814MKbYJlLCYqJUcoquNs9yrUmxQP8/AU=
      I haven't tested either of these codes, you will need to test yourself to see if they work. Make sure you give the script both the spawn object, and the new spawn location object

    • @taco_boi
      @taco_boi Před 4 měsíci

      @@PlayerBush001 Uh, I don't really know where to put those codes-

    • @taco_boi
      @taco_boi Před 4 měsíci

      Also, my question was, how do I get the script to work in vr, cause it just doesn't when I play test it

    • @PlayerBush001
      @PlayerBush001  Před 4 měsíci

      @@taco_boi on any object in your scene, though it would probably look cleaner if it was on its own empty gameobject, or in the VRCWorld. If you are referring to what to do with the chunk of text, look at my relatively recent video on sharing udon codes via text

    • @PlayerBush001
      @PlayerBush001  Před 4 měsíci

      @@taco_boi it being in vr or not shouldn't mater. This is fully to do with the capsule collider of the player; so vr/ desktop and phone should all behave the same

  • @SuperShadow
    @SuperShadow Před 2 lety +1

    so the owner refers to the world instance owner?

    • @PlayerBush001
      @PlayerBush001  Před 2 lety +1

      Not quite. Vrchat works on a master - slave system when it comes to synced variables. This means you need an owner of an object that will manage all synced variables, and then every other client will copy those results instead changing them themselves. We can use that owner value to see who owns the script, and we can use a 'networking, set owner' node to change it to whoever we like. It's a nice easy way for me to get the object to follow a single player for everyone.
      In this case however, as we haven't specified who the owner is, it will just default to the owner of the world. If the current owner of an object leaves, it will revert back to the instance owner

  • @neowolf09
    @neowolf09 Před 11 dny

    How to make something a child of something else? I'm new 😭

    • @PlayerBush001
      @PlayerBush001  Před 11 dny

      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 ^^