Re-center your VR Player in Unity

Поділитися
Вставка
  • Опубліковано 27 жов 2024

КОМЕНТАРІ • 58

  • @anmaavr8315
    @anmaavr8315 5 місяців тому

    Love the sensor tape tip! Thank you always making a awesome tutorial!

  • @kingminor
    @kingminor 2 роки тому +4

    Can't wait to use this feature in a game. Maybe a multiplayer flight sim? (Was that to subtle of a hint that I want a multiplayer tutorial)

  • @buffoverflow
    @buffoverflow 10 місяців тому

    Thank you from 2023! Love you man!

  • @adhochero6619
    @adhochero6619 Рік тому +3

    on the rotation angle part, to make sure you do the calculation correct and don't have to -rotationAngleY, it is destination - origin. so the place you want to be minus the place you are, or in this case rotation you are. that will give you the right value.

    • @JustinPBarnett
      @JustinPBarnett  Рік тому +2

      Good tip

    • @adhochero6619
      @adhochero6619 Рік тому

      ​@@JustinPBarnett I did have a question on how to ensure the player is in the correct position at the start of the game. the repositioning in this tut works on the button press, but if I try and run it in start the player isn't repositioned.
      seems like the tracking position is being set afterwards, so not sure when is the right time to call it to get that to work.

    • @justaddvr
      @justaddvr 8 місяців тому

      I've got the same issue, the tutorial code works perfectly when triggered from the 'Context Menu' but does not work when calling it directly from the code, since the XR Rig falls through the floor. It looks like it takes Unity a short time to load up the 3D environment, so maybe putting a check into the code to ensure the floor is loaded would work before trying to reposition the XR Rig and main camera?

    • @yagneshkrishnan2544
      @yagneshkrishnan2544 5 місяців тому

      @@justaddvr Did that work out for you?or did you get any alternate solution?

  • @maxrichhart4929
    @maxrichhart4929 2 роки тому +1

    Missed you bro!

  • @timvandeneng4724
    @timvandeneng4724 Рік тому +1

    Great tutorial! thanks man!

  • @MythicalDevs
    @MythicalDevs 2 роки тому +1

    Hey Justin! Can you make a tutorial on how to climb in vr?

  • @jr8209
    @jr8209 Рік тому +2

    $5 per super useful bit info I get from you. Centering & tape over sensor. Thanks bud!

  • @jjcplays536
    @jjcplays536 2 роки тому +1

    can you please make a tutorial on how to switch between teleportation and smooth walking and by the way you make the best tutorials, thank you so much

  • @giovannimurru
    @giovannimurru Рік тому +1

    Hi Justin, Thanks for the video. Great content as always. I see you are using tape on the sensor to keep the Quest always on. I have just a tip that maybe you don't know. There's an option in the Meta Quest Developer Hub app to disable the proximity sensor and also another one to ADB your app over Wi-Fi.

  • @TheARTofMining
    @TheARTofMining 7 місяців тому

    Good video and thank you for it - HOWEVER IT DOES NOT SOLVE THE BIGGER ISSUE WITH VR ORIENTATION using XR.
    I have multiple scenes each that require the player to start facing a UI screen when the scene(s) loads.
    Despite hours of searching I have found no reliable solution as yet!
    I'm sure it's something the the XR interaction toolkit guys really should focus on.
    When you launch your VR game the XROrigin & Camera orientations of direction do not follow the splash screen direction(Unity Logo).
    I have tested starting my game, standing at a certain rotation angle while the splash screen appears. This puts me in whatever rotation. I then quit the app and physically turn 90 degrees and then start the app again.
    My orientation is turned to the corresponding 90 rotation, indicating that it does not orientate from the splash screen it orientates from your boundary setup I think!
    Wouldn't it be much simpler for the XR interaction toolkit to provide a RESET functionality? Such that when you load your game or a scene, a RESET would take the whole rig, block and disable the camera (instant FadeOut like teleport does),
    and then reset the camera Y rotation to zero and also zero out the camera position to the XROrigin position. Then re-enable the camera (quick Fadein like teleport does).
    This way you could set the XROrigin to a target (GO) position and rotation and the RIG would comply to those position and rotation values of said target.
    This code below puts the XROrigin in the correct target position, but if I walk away from center or physically turn that becomes a positional and rotational offset.
    [
    var rotationAngleY = MainCamera.transform.rotation.eulerAngles.y - targetTeleportLocation.transform.rotation.eulerAngles.y;
    PlayerXR_Origin.transform.Rotate(0,rotationAngleY,0);
    PlayerXR_Origin.transform.position = targetTeleportLocation.transform.position;
    ]
    What I need is to be able to recenter the CAMERA to the XROrigin *(simple in theory) but I have not discovered a way!
    InputTracking.Recenter - This only works with seated and standing experiences. Room scale experiences are not affected by Recenter and I see tons of issues with people trying to implement.
    Jeez how hard can it be for XR guys to integrate this?
    Rant over!
    Cheers

  • @endyrz
    @endyrz Рік тому

    exactly what i've been looking for, thank you!

  • @SamSamTutorialMan
    @SamSamTutorialMan 2 роки тому +1

    thanks. you saved my butt

  • @mannplaza2968
    @mannplaza2968 2 роки тому +2

    Thanks!

  • @radari7180
    @radari7180 7 місяців тому

    Thank you very much!

  • @AvaliaTec
    @AvaliaTec 2 роки тому

    Hey Justin can you teach us how to add avatars and configure they?

  • @lupus41
    @lupus41 2 роки тому +1

    Hey can you do an tutorial about velocity controller tracking in VR i don't understand it right know

  • @josemartins-game
    @josemartins-game Місяць тому

    Usefull. Thanks.

  • @futebol258
    @futebol258 Рік тому +1

    Now I have a problem, when I look to the left the view moves to the right and vice versa, how can I solve this?

  • @Battlestad
    @Battlestad 2 роки тому

    Great video. These are helping me out ALOT. Can you make a tutorial on how to make your own VR home for the Quest? I have a scene ready and all, but Im stuck on how to import it as a home environment

  • @JonHuhnMedical
    @JonHuhnMedical 2 роки тому +1

    Looks like this only works if the XR Origin is level. In a flight sim scenario where it could be oriented in all kinds of crazy ways, this code gives unpredictable results.

    • @RazReags
      @RazReags Рік тому

      I think the reset point would be set to the aircrafts seat position instead.

  • @jayyap39
    @jayyap39 2 роки тому +2

    Hi Justin, actually can we just use the equal "=" sign to directly change the current player.transform.position to reset.position? Because what're we doing right now is minus it and plus it back at the next line

    • @JustinPBarnett
      @JustinPBarnett  2 роки тому +2

      Try it and see, but yea that should work.

  • @celsofilho8739
    @celsofilho8739 Рік тому +1

    Thanks for the video!!!! One more sub!!!

  • @RichardC28
    @RichardC28 2 роки тому

    Great video, life saver!

  • @PixelRacoon
    @PixelRacoon Рік тому

    Stupid question, you know how to do that with HurricaneVR? It seems the rotation doesn´t work.

  • @kitws
    @kitws Рік тому

    Thank you!

  • @FantiniMotion
    @FantiniMotion Рік тому

    Instead of adding the distance difference, why just not simply set the transform position of the player to the desired reset position: player.transform.position = resetTransform.position; And thank you so much for this video.

  • @rosx_8446
    @rosx_8446 2 роки тому

    yo can you make a tutorial on how to make hand animations with an IK avatar in unity vr?

  • @alexanderkupin9933
    @alexanderkupin9933 2 роки тому +2

    Is there an equivalent way to do this for the Oculus integration?

    • @RupertsTech
      @RupertsTech 7 місяців тому

      Exactly the same method

  • @JustinPBarnett
    @JustinPBarnett  2 роки тому +1

    Download the Source Code: value.vrcreators.io/recenter

    • @GameRevenant
      @GameRevenant Рік тому

      I was wondering how I could override the Oculus button (Meta Quest 2) so that when someone holds down the button, we call this code. Right now in my game the Oculus button always brings up the Oculus menu and I can't seem to make extra behaviors happen...

  • @tristan6052
    @tristan6052 Рік тому

    bro thanks.

  • @ellieelias6336
    @ellieelias6336 2 роки тому

    Hello! I love your videos and had a QUESTION that's got me stuck! ... I've just started learning about Unity and Blender and all things VR ... one thing I can't wrap my head around is the concept of "game compacity" I know more polygons = more details = needs more running power. But I see games like "Zenith: The Last City" running on the quest 2 as basically an MMO ... then games like "A Township Tale" that had to cut a lot of things just to load on quest and cant hold more than 8 players... which has left me really confused (just for random example, both great games). But how do I know the game I'm planning out will run on the device I want? Even if I look up the limitations of the device, how do I make sure my game will fall into that scope? How do I start to measure something like that and plan it correctly? (I get it probably comes with experience, but my brain wont really let me move past this until I start to understand) If this needs more information to answer, or the question doesn't make sense, let me know! I'm really stuck on this. (I have more questions about how to make games feel bigger or have more players while loading smoothly, but this is already pretty long, haha!)

  • @omerfarukkoca6051
    @omerfarukkoca6051 10 місяців тому

    you are god

  • @lsdevelopment7055
    @lsdevelopment7055 2 роки тому

    Hello. In VR, my pictures look glowing. What could cause these flares? Even if I turn off the light, the flashes continue. Could it be related to the resolution of the images? Have you encountered such a situation before?

    • @mannplaza2968
      @mannplaza2968 2 роки тому

      Maybe it is the graphics you imported and the graphic rendering of your project. For example I imported some assets that were for UDP into a Unity 3d project and it looked horrible.

  • @danielruizleyva3825
    @danielruizleyva3825 Рік тому

    I am trying to reset the camera when loading a new scene (to force the user look at a certain point in the new scene) but cant make it work, any ideas?

    • @theshortbowwithmasterwork2832
      @theshortbowwithmasterwork2832 Рік тому

      My quick and dirty fix was to put in a small timer that after one second calls the reset function. In that time frame the mixed reality application startup animation still plays on startup so i hid it away that way. Maybe I'll find something better...

  • @yanetgarsia1844
    @yanetgarsia1844 2 роки тому

    The legend of QUINZAA.Monster is the best ! snowquen's is my idol. Hes the person I aspirev to be, hes my light of day.

  • @kingminor
    @kingminor 2 роки тому +2

    First comment.

    • @SimpleDays101
      @SimpleDays101 2 роки тому +1

      Congrats. You win... Nothing!

    • @kingminor
      @kingminor 2 роки тому

      @@SimpleDays101 True lol

  • @amberking8567
    @amberking8567 2 роки тому

    Felicidades, es un buen ejemplo. 233 sentadillas son unos QUINZAA.Monster muchas y un buen ejercicio. Se deja ver que hay muy buenos resultados 😍👍 Saludos desde la Cd.. de world 🌹😉💖 los mortalesm abian apreciado tan hermosa mujer.k

  • @mannplaza2968
    @mannplaza2968 2 роки тому +2

    Thanks!

    • @mannplaza2968
      @mannplaza2968 2 роки тому +1

      This saved me hours of time! Thank you. "Much Success!" - Borat

    • @JustinPBarnett
      @JustinPBarnett  2 роки тому

      Thanks so much!!