Re-center your VR Player in Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024

ความคิดเห็น • 57

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

  • @anmaavr8315
    @anmaavr8315 4 หลายเดือนก่อน

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

  • @buffoverflow
    @buffoverflow 9 หลายเดือนก่อน

    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 7 หลายเดือนก่อน

      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 4 หลายเดือนก่อน

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

  • @jr8209
    @jr8209 ปีที่แล้ว +2

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

  • @maxrichhart4929
    @maxrichhart4929 2 ปีที่แล้ว +1

    Missed you bro!

  • @mannplaza2968
    @mannplaza2968 2 ปีที่แล้ว +2

    Thanks!

  • @MythicalDevs
    @MythicalDevs 2 ปีที่แล้ว +1

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

  • @radari7180
    @radari7180 6 หลายเดือนก่อน

    Thank you very 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.

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

  • @lupus41
    @lupus41 2 ปีที่แล้ว +1

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

  • @timvandeneng4724
    @timvandeneng4724 ปีที่แล้ว +1

    Great tutorial! thanks man!

  • @SamSamTutorialMan
    @SamSamTutorialMan 2 ปีที่แล้ว +1

    thanks. you saved my butt

  • @TheARTofMining
    @TheARTofMining 6 หลายเดือนก่อน

    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!

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

  • @nando3d
    @nando3d 2 ปีที่แล้ว

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

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

    • @JustinPBarnett
      @JustinPBarnett  ปีที่แล้ว

      Sounds like you inverted your player??

    • @futebol258
      @futebol258 ปีที่แล้ว

      yes
      @@JustinPBarnett

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

  • @kitws
    @kitws ปีที่แล้ว

    Thank you!

  • @alexanderkupin9933
    @alexanderkupin9933 2 ปีที่แล้ว +2

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

    • @RupertsTech
      @RupertsTech 6 หลายเดือนก่อน

      Exactly the same method

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

  • @PixelRacoon
    @PixelRacoon ปีที่แล้ว

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

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

  • @tristan6052
    @tristan6052 ปีที่แล้ว

    bro thanks.

  • @rosx_8446
    @rosx_8446 2 ปีที่แล้ว

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

  • @celsofilho8739
    @celsofilho8739 ปีที่แล้ว +1

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

  • @RichardC28
    @RichardC28 ปีที่แล้ว

    Great video, life saver!

  • @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 9 หลายเดือนก่อน

    you are god

  • @JustinPBarnett
    @JustinPBarnett  2 ปีที่แล้ว +1

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

    • @GameRevenant
      @GameRevenant 11 หลายเดือนก่อน

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

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

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

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