Re-center your VR Player in Unity

Поделиться
HTML-код
  • Опубликовано: 27 янв 2025

Комментарии • 60

  • @jr8209
    @jr8209 2 года назад +3

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

  • @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!!

  • @anmaavr8315
    @anmaavr8315 8 месяцев назад

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

  • @maxrichhart4929
    @maxrichhart4929 2 года назад +1

    Missed you bro!

  • @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 Год назад

      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 8 месяцев назад

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

  • @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 Год назад

    Thank you from 2023! Love you man!

  • @timvandeneng4724
    @timvandeneng4724 Год назад +1

    Great tutorial! thanks man!

  • @endyrz
    @endyrz 2 года назад

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

  • @lupus41
    @lupus41 2 года назад +1

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

  • @MythicalDevs
    @MythicalDevs 2 года назад +1

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

  • @espicelmecanicodecombustio1632
    @espicelmecanicodecombustio1632 2 месяца назад

    well explained. good vid

  • @ShiveringTales-t1y
    @ShiveringTales-t1y 2 года назад

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

  • @alexanderkupin9933
    @alexanderkupin9933 2 года назад +2

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

    • @RupertsTech
      @RupertsTech 10 месяцев назад

      Exactly the same method

  • @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?

  • @userbunny14
    @userbunny14 2 месяца назад

    ugh I thought this was going to be about how to get the character back in the middle of the screen. I was trying to turn the model around to see the back and it went off screen and now I can't find it again.

  • @SamSamTutorialMan
    @SamSamTutorialMan 2 года назад +1

    thanks. you saved my butt

  • @RichardC28
    @RichardC28 2 года назад

    Great video, life saver!

  • @TheARTofMining
    @TheARTofMining 10 месяцев назад

    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

  • @kitws
    @kitws 2 года назад

    Thank you!

  • @radari7180
    @radari7180 10 месяцев назад

    Thank you very much!

  • @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

  • @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.

  • @giovannimurru
    @giovannimurru 2 года назад +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.

  • @rosx_8446
    @rosx_8446 2 года назад

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

  • @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.

  • @josemartins-game
    @josemartins-game 4 месяца назад

    Usefull. Thanks.

  • @PixelRacoon
    @PixelRacoon 2 года назад

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

  • @celsofilho8739
    @celsofilho8739 Год назад +1

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

  • @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

  • @danielruizleyva3825
    @danielruizleyva3825 2 года назад

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

  • @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.

  • @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.

  • @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.

  • @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 Год назад

    you are god

  • @kingminor
    @kingminor 2 года назад +2

    First comment.

    • @SimpleDays101
      @SimpleDays101 2 года назад +1

      Congrats. You win... Nothing!

    • @kingminor
      @kingminor 2 года назад

      @@SimpleDays101 True lol

  • @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.

  • @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!