Download the Project (for FREE): www.vrcreators.io/codedownloads
@riverboatgambler34015 ай бұрын
Great video. I'm following you now. You do an amazing job. The code download link is dead though. Also, your picture during the coding obscures some of the code you write. This is really a problem when you're typing literal strings (as in the case of the action maps). Thanks!
@tczhou99693 жыл бұрын
For anyone who wants to make the function working on the right hand instead., here are the steps: 1. In the script, change the "XRI LeftHand" to "XRI RightHand" 2. [Important] Make sure the XRI RightHand's "Move" action is not empty, if there is no action relates to it, click on the + button and choose "Add binding". In the path, choose "Primay2DAxis [RightHand Controller]". (By default, there is no move action in the Right Hand controller, if you don't add the Move action, the `_thumbstick.trigger` is always falsy, and as a result, the teleport beam will stay active and cannot be cancelled by releasing thumbstick.) 3. Drag the right hand raycaster to the script
@JustinPBarnett2 жыл бұрын
Thanks!
@hans-henrikjensen2 жыл бұрын
You can find an example on discord in vr-resources
@cirelachlan2 жыл бұрын
Best part of the video was admitting you couldn't figure out the rotation. Your video is helping me a lot with my project and seeing someone humble about learning and their knowledge is awesome.
@MatanNaveh3 жыл бұрын
Hey, your channel just got recommended for me and I have to say that I'm only 10 minutes in and I'm really impressed! I can see you put a lot of work and effort into these videos and I know that if you'll keep uploading that often your channel will be very known. I like the camera and the lights behind it and it's really given me a studio and professional feeling. Right now I don't have a VR headset but I'm planning on buying one soon. Keep up the great work man, I appreciate your effort, Matan.
@JustinPBarnett3 жыл бұрын
Wow, I really appreciate all the praise and encouragement Matan! Thanks so much! (And getting a VR headset is SO fun!)
@ishakgamingspider87433 жыл бұрын
Your channel is very cool man I didn't know anything about vr but when I found your channel my life changed❤
@JustinPBarnett3 жыл бұрын
Welcome aboard!
@shanghai752 Жыл бұрын
Hello Justin! Your video is amazing and easy to understand! Here are my tips: First,the XR interaction tookit has updated and the action map has changed; The input actions like “Teleport Mode Activate” and "Teleport Mode Cancel" have been moved to the XRI LeftHand Locomotion. Secondly, I found the teleportion does not go as well as I expected : When I release the thumbstick , I found myself teleported to somewhere else instead of the XR ray hit point. Finally ,I found that the rayInteractor.enabled and _isActive should be set false after the method QueueTeleportRequest being excuted.If you don't do that, the teleportation method may be excuted many times during the time the thumstick returning back to the origin. Thanks a lot!
@jeremyledermann4281 Жыл бұрын
Thanks a lot, I was on this issue for like 2hours, you save me !
@gtxo21043 жыл бұрын
these vr tutorials are very cool I have to say. I am making a spiderman game, imagine how sick that would b in VR
@JustinPBarnett3 жыл бұрын
That would be incredible!!
@haraldgundersen73033 жыл бұрын
You should try out vrinteraction framework by Bearded Ninja
@JustPhil3 жыл бұрын
ich like your stuff a lot...thx!! one suggestion: your cuts are often very fast, so that i can almost not follow what you are doing.. a little little bit slower might be better :)
@JustinPBarnett2 жыл бұрын
Thanks for the tip!
@lacoors3 жыл бұрын
Just a question if i try to teleport outside of the plane i get a red ray and the code prevent me to do it just like u show it in the video. But if we add a cube or bowling alley ;) over the plane and don't add a teleportation area to it. Even if i get a red ray when i pass over it when i realease the thumbstick it will teleport me on that area anyway any clue why ???
@JustinPBarnett3 жыл бұрын
Oh I think I forgot to add a check on the hit.gameobject for a teleportation area! You’ll need to add that and determine if you can teleport on not using that. Good catch!
@lacoors3 жыл бұрын
@@JustinPBarnett Thanks for the advice i have modify the test in the update for : if (!_rayInteractor.GetCurrentRaycastHit(out RaycastHit hit) || hit.transform.GetComponent() == null) { _rayInteractor.enabled = false; _isActive = false; return; } and now it work. I can't teleport on a non teleportable area. Non sure it's the best way to do it but it worked :)
@JustinPBarnett3 жыл бұрын
@@lacoors Yup! good catch & solution
@mrstruijk3 жыл бұрын
Hi Justin! Thanks for the tutorial, that really helped me along. One thing that didn't work out for me was that my teleportation happened pretty much instantaneously. The 'thumbStick.triggered == true' did not behave as expected. To fix this, I first created a new action for the Primary2DAxis, which I set to 'Value' and 'Vector2' as the Control Type. I then referenced that action instead of the Move action in the code, and used 'if (thumbStick.ReadValue() != Vector2.zero) { return; }'. This worked for me, I hope someone else finds it useful too.
@JustinPBarnett2 жыл бұрын
Glad you got it working!
@jacobclaytor59992 жыл бұрын
Thank you very much for this. I could not figure it out the for the life of me. Another thing I did was got rid of the isActive boolean. Since we are already toggling rayInteractor enabled/disabled, just check that boolean to simplify the code a bit.
@parse_error2 жыл бұрын
Thanks! I spent 1h trying to find why my thumbstick wasn't staying on triggered state (had the problem only in build, not in editor) and your solution worked for me ;)
@eTxsicWtKUEbBwaQicQJuOPKgW2 жыл бұрын
OHHHHHHHHHHHHHHHHHHHHHHHHHHH IT WORKS PREFECTLY!
@winn88882 жыл бұрын
Same thing here - thank you for this excellent solution. I didn't even need to set up a new input action, I just left the reference to the existing Move action and used your code in the update loop and it sorted the issue for me.
@fateshow53032 жыл бұрын
Great videos, sending my support, keep doing what yr doing yr great!
@JustinPBarnett2 жыл бұрын
Thank you so much!!
@matiaspina2323 Жыл бұрын
I found this comment below "This teleportation method has nice behaviour in the editor, but in the android build, teleportation happens immediately when I press the joystick" Anyone found the solution? Thanks! Your videos are amazing, help me a lot!!
@jakehrr Жыл бұрын
I'm having the same thing - I had this working 2 weeks ago and then I come back to my project this week and I'm getting this happen now
@hansshadow3603 жыл бұрын
Hi, i do this tutorial. But my Unity editor not response to oculus controller click... you know any solution? Unity can track the controls movement but for example i cant teleport with buttons in my unity editor.
@JustinPBarnett2 жыл бұрын
Join the discord and we can help you troubleshoot!
@greg2fs Жыл бұрын
I don't see the problem about setting the rotation about the thumbstick position, just save the thumbstick vector2 when it' is greater that 0.9f for example, and calculate the rotation with that
@Atlar2 жыл бұрын
I really liked the tutorial it was easy to follow and easy to implement. Not sure if anyone proposed a solution but I did manage to get the facing issue resolved. Not sure if it's the best solution but it does work. I created a standalone GameObject to use as a recticle. I gave the object an obvious "front", enable, and place it at the hit point whenever the rayInteractor "isActive". There's a little math to convert the 2d axis into a rotation angle Vector2 directionVec = thumbStickAction.ReadValue(); float angle = Mathf.Atan2(directionVec.y, directionVec.x) * Mathf.Rad2Deg; landingReticle.transform.rotation = Quaternion.Euler(new Vector3(0, -angle, 0)); // This is assuming you're rotating around the Y axis. Some minor adjustments to align the objects "forward" with the angle you have to add 2 lines to the teleportRequest code. teleportRequest.matchOrientation = MatchOrientation.TargetUpAndForward; //
@JustinPBarnett2 жыл бұрын
Thanks! And good way to fix that
@olivername Жыл бұрын
I have done this but the line is not always on the hands in middle of the plate
@curtisturpin93892 жыл бұрын
Here's the solution I found for the Rotation problem you ran into: I use a game object as the "Reticle" for the XR Ray Interactor > XR Interactor Line Visuals. I then use the joystick input, find the direction based on the Vector2 and the Transform of the controller being used > ```Vector3 joystickDirection = controllerTransform.right * joystickRotationValue.x + controllerTransform.forward * joystickRotationValue.y;``` after this, you want to 0 out the Y coordinate of of joystickDirection.y to keep the reticle flat against the ground. ```joystickDirection.y = 0``` I also normalized the joystickDirection, but I don't think it's necessary I then use that to rotate the Reticle > ```Quaternion newRotation = Quaternion.LookRotation(forwardDirection, Vector3.up); reticleTransform.rotation = Quaternion.RotateTowards(reticleTransform.rotation, newRotation, 10000 * Time.deltaTime);``` Then in the Teleport Request > ```destinationRotation = new Quaternion(0, Mathf.Round(reticleTransform.rotation.y), 0, 0), matchOrientation = MatchOrientation.TargetUpAndForward``` Essentially, serializing the rotation of the joystick inside the Tranform of the reticle and applying that during the teleport request. I'm currently running this under the Update method, but only if my teleporter is currently active. I'm looking to find a way to get this out of Update() so it's not checking for an if statement every frame.
@olivername Жыл бұрын
hi I got issue where the rays don't work and the move on controllers could you please help thanks
@sebastien4507 Жыл бұрын
In my case i kept teleporting, so I managed to fix it when you disable the rayInteractor and isActive variable at the end of your update
@chills_203 жыл бұрын
can you teleport without the VR Headset and just mouse-click around? Also, how can I save this as a phone or website for people to access?
@JustinPBarnett3 жыл бұрын
Yea I'm sure it's entirely possible to do with a FPS or 3PS style game. Not sure what you mean by save as a phone or website though? Can you elaborate?
@JayPatel-sw2fh3 жыл бұрын
@@JustinPBarnett means, how we can test this VR Game in Mobile that you are testing in game panel in unity. Also do we need VR Headset to teleport it?
@azataiabylbek52622 жыл бұрын
Thank you Justin^^ You're awesome~
@JustinPBarnett2 жыл бұрын
Thanks so much!!
@bluurayr2 жыл бұрын
Am I missing something or how am I able to use the left hand to teleport and be able to grab objects at the same time?
@JustinPBarnett2 жыл бұрын
Should be the same ray interactor, you'd just need to leave it on all the time (or make it visible when hovering over an interactable object)
@bluurayr2 жыл бұрын
@@JustinPBarnett Thanks for the fast reply (and the Tutorial) :) Unfortunately I do not have any programming knowledge and do not know how to do this. I tried to copy part of the code from your VR Hands tutorial and I can't get it to work. So I will just accept that and will only grab with the right hand :D
@veaarthur36552 жыл бұрын
Why did you leave Teleport Mode Cancel set to "gripPressed"?
@JustinPBarnett2 жыл бұрын
I'm going to do an update video on teleporting soon. Not super happy with the solution in this video and I feel like there's a better way to do it.
@mayadaaq7113 жыл бұрын
I followed everything exactly but I don;t seem to teleport to the hit point but flying so fast around!
@JustinPBarnett2 жыл бұрын
Join the discord and we can help you troubleshoot!
@knightcube3 жыл бұрын
Great video! How do I teleport using Eye Gaze Interaction?
@JustinPBarnett2 жыл бұрын
Haven't looked into that yet...
@russellgilbertdecastro70313 жыл бұрын
Hmmm I feel like I've seen this guy... great content!
@JustinPBarnett3 жыл бұрын
Hey, thanks!
@DanielSantallaa3 жыл бұрын
The ray casted from the hand is rotated 90 degrees on the Z axis. Any idea of how to correct this?
@JustinPBarnett3 жыл бұрын
Try creating an empty game object as a child of each controller and rotate that to where you like it. Then you can move the ray interactor and line renderer component to the child object and that should work.
@DanielSantallaa3 жыл бұрын
@@JustinPBarnett thanks!
@danread12172 жыл бұрын
Nice tutorial, and demonstrates the logic by linking input to action. Quick question- why wouldn't you use a Player Input component to isolate the control action and use it to broadcast to your methods in the Teleportation Manager? That removes the need to hard-code a controller input and gives more flexibility further down the line (which is what the new Input System aims to do).
@JustinPBarnett2 жыл бұрын
That's actually a really great suggestion! Should work pretty good
@danread12172 жыл бұрын
@@JustinPBarnett Yep- works an absolute treat! Will write it up when I get 5 minutes...
@lop2582 жыл бұрын
Hi Justin, how would you create teleportation area on complicated meshes, such as it is in walkabout mini golf or Star Wars Tales from the Galaxy Edge?
@JustinPBarnett2 жыл бұрын
Just add a teleportation area to the mesh!
@xZeroCCx3 жыл бұрын
Random guess, but to get the rotation for the teleport couldn't you disable the snap turning while the teleport is active, and use the right hand to handle your teleport rotation?
@JustinPBarnett3 жыл бұрын
That's a possibility, but I'd love to be able to use the same stick I'm using to teleport to also set the rotation.
@xZeroCCx3 жыл бұрын
@@JustinPBarnett Hmmm, Does your thumbstick have a "Middle click" so instead of teleporting on releasing the stick you could teleport on clicking it, and track the rotation before clicking. Or like enter tp mode by moving the stick, use the stick to rotate and then pull the trigger to finalize the tp.
@xZeroCCx3 жыл бұрын
Firing the TP on stick release works, but unless you find an invalid target there isn't a way to cancel our teleport right?
@Ariel162833 жыл бұрын
@@xZeroCCx There is a game called Fuji on the quest, they set up the controls so you can teleport with both sticks, but if you are teleporting with one and try to start to teleport with the other it just cancels the current teleport.
@Ariel162833 жыл бұрын
I actually think it is more natural to have the teleport on release of the sticks. Pretty much the majority of the VR games have it implemented like this, so thats what people will expect.
@ScratchedWinter3 жыл бұрын
@12:01 No idea what you did here ?
@Breyyne3 жыл бұрын
I believe he is using Rider for coding which has shortcuts for such things as adding declarations for Variables that you add in later.
@JustinPBarnett2 жыл бұрын
Yea I use JetBrains Rider, so I just have some hotkeys that I forget to mention sometimes
@rodrigo.cs.machado Жыл бұрын
hello, I have a small problem involving teleportation. I'm instantiating the player in the scene because the phase is a multiplayer one, however the "teleportation area" script that is on the ground for the use of the teleport only recognizes the "teleportation provider" script of the player if he is already in the scene when the player comes. how to solve it? I already tried dragging and dropping the script directly from the prefab to be instantiated but it didn't work...
@timpixel3679 Жыл бұрын
You could set the references inside the start method of the Teleportation Manager that was created here. This is just an example for one teleport object, if you have multiple areas or anchors you need to do some kind of loop. void Start() { var teleportArea = FindObjectOfType(); teleportArea.teleportationProvider = GetComponent(); // here comes the other code from this tutorial }
@connormarkus83983 жыл бұрын
Why does the XR Rig have to be at 0, 0, 0. What should i do if i am trying to play from a different location?
@JustinPBarnett3 жыл бұрын
It doesn’t have to be! You can start from anywhere. That was just me being OCD 😅
@stephenmackenzie90163 жыл бұрын
Any reason I can’t see the channels in Discord, only welcome, landing page and chat with Justin?
@JustinPBarnett3 жыл бұрын
Did you accept the rules?
@stephenmackenzie90163 жыл бұрын
@@JustinPBarnett how do I do that, I just read them?
@pozlong86143 жыл бұрын
Super clear and helpful! I got this one and the hands to work but now my grabbables are no longer grabbable. What do you think I broke?
@JustinPBarnett3 жыл бұрын
Are all the layers set correctly and not conflicting?
@pozlong86143 жыл бұрын
@@JustinPBarnett Thanks for the reply & good question! It might have something to do with the models I downloaded (temp models) for the scene. When I use a basic sphere I can grab via the ray, ideal case I could grab with the hands from previous tutorial. I'll have to try it with the real models once I get them.
@andriy_z3 жыл бұрын
This teleportation method has nice behaviour in the editor, but in the android build, teleportation happens immediately when I press the joystick
@silwer2223 жыл бұрын
same for me, it is almost instant in Quest 2
@andriy_z3 жыл бұрын
@@silwer222 I done it in another way, I can share my solution if you need it
@silwer2223 жыл бұрын
@@andriy_z It would be great :D
@HaniSharif3 жыл бұрын
Андрій Зімбіцький please share it
@danielgarciagonzalez23913 жыл бұрын
@@andriy_z I would like to know how you fixed it as well, please.
@Andrew-he5gj3 жыл бұрын
Great tutorial !
@JustinPBarnett3 жыл бұрын
Thank you! Cheers!
@vitchi2 жыл бұрын
Thank you for the cool video! I came here to see if I could figure out how to add a cool-down to the teleportation because I would like the user to take in the environment before moving on too quickly but I couldn't quite figure it out. Should I use some sort of timer in combination with the provider.QueueTeleportRequest() for this or do you have any other idea?
@WolfServant2 жыл бұрын
Anyone figure out the rotation? Also anyone else having the bug where you don't stop teleporting?
@JustinPBarnett2 жыл бұрын
Yea there's a few bugs with this one, I'm trying to do an update video about teleporting pretty soon
@GiantBean2 жыл бұрын
@@JustinPBarnett It would be great if you could add to the update how to change the length of the teleport arc based on the amount the thumb stick is pressed Although it would likely then need to activate with trigger rather than release.
@BonCreations3 жыл бұрын
Awesome tutorial! This is really helping with my coursework for my Uni. However, I've encountered a problem where the error code is the following: NullReferenceException: Object reference not set to an instance of an object TeleportationManager.Start() (at Assets/TeleportationManager.cs.20) I've checked the code on line 20 and it seems that it was this line "var activate = actionAsset.FindActionMap("XRI LeftHand").FindAction("Teleport Mode Activate");" that Unity wasn't liking. Been trying to solve this for over an hour by going through the tutorial and still no results. Any advice?
@JustinPBarnett3 жыл бұрын
Do you have an action of that name set up?
@BonCreations3 жыл бұрын
@@JustinPBarnett If you are talking about the names for the action e.g. InputActionAsset actionAsset, then yes! Somehow the error didn't show up anymore but have encountered another problem, where the teleportation ray doesn't appear at all when I try to pull the thumbstick towards me or the opposite direction. Perhaps it might be easier if I just post a screenshot of the code that I've copied from yours and see if there is any error... Sorry for the inconvenience! i.imgur.com/YC11vSB.png
@JustinPBarnett3 жыл бұрын
@@BonCreations I’m starting to think that you didn’t set something in the inspector. Like for got to attach the action asset in its slot in the teleportation manager. Your code looks fine as far as I can tell
@BonCreations3 жыл бұрын
@@JustinPBarnett I also have completed that step by dragging the XRI Default Input Actions to the slot. Thought it would be worth mentioning, is that I have also followed the continuous movement tutorial that you have uploaded before and I tried to combine both of them together. I was wondering if the continuous movement tutorial that I also followed and applied to the same XR Rig before might be the reason for the error?
@JustinPBarnett3 жыл бұрын
@@BonCreations hmmm so you’re trying to use continuous movement and teleportation at the same time?
@user-kj1fq8vn8f2 жыл бұрын
Thanks for the tutorial. I have a question that if I use the Teleportation Manager script in the video, I can teleport to the area which does not have "Teleportation Area" script. However, my expectation is to teleport only on teleport areas, so could you give any suggestions to solve this problem?
@lenoardliu2134 Жыл бұрын
Have you solved the problem?
@InteractViz2 жыл бұрын
HELP Please. Script is telling me that it does not recognize - QueueTeleportRequest any idea how to fix it?
@JustinPBarnett2 жыл бұрын
If you're still having issues join the Discord and we can help you troubleshoot in #dev-help!
@TwistdRabbit2 жыл бұрын
Hey Justin, awesome tutorial as always, got an issue, i managed to get everything working but the reticle wont appear when i add it, any ideas?
@jakewarr69422 жыл бұрын
Hi Justin, thanks for the tutorial. Do you plan on making an updated tutorial for Unity 2021, It looks like some of the API's have changed and this no longer works :( also in future videos showing the full line of code and going a bit slower when creating the variables/autofilling would really help out a lot.
@JustinPBarnett2 жыл бұрын
I definitely need to make an updated teleportation video
@lacoors3 жыл бұрын
This method works fine with Quest2 joystick or controllers with a joystick but is there a way to make this work with HTC Vive Wand Controller cause the Keypad auto teleport on pointing even if i dont release it. I can't find the way to put this on the KeyPad Press instead of Touch
@JustinPBarnett3 жыл бұрын
You'll need to go into the Input Actions and find the HTC Vive Wand controller option and pick the specific input you want to use from that. So around 8:30 instead of using those action maps you can create your own specific one to use and map to.
@lacoors3 жыл бұрын
@@JustinPBarnett But is it possible to make both controllers work in same app ? Like is it possible in script to detect which system i am using and call the actions according to the headset ?
@JustinPBarnett3 жыл бұрын
@@lacoors Tbh I haven't found a good way to detect what controller is being used yet. It should be possible, but I'm not sure how
@ArendRaifsnider3 жыл бұрын
Thanks for these tutorials. I'm able to get the raycast to come out and the grip to deactivate it but releasing the thumbstick doesn't do anything - the ray just remains cast and it doesn't teleport. The only difference I'm able to see in the script is that Unity made me update GetCurrentRaycastHit to TryGetCurrent3DRaycastHit. Any thoughts on what I might be missing?
@Breyyne3 жыл бұрын
As far as I've been able to tell, GetCurrentRayCastHit still works. Though I am trying to figure out a Flicking issue with my Ray. Are you sending the TeleportQueueRequest? Just switch over to TryGetCurrent3DRaycastHit and it seems to be working out for me.
@ArendRaifsnider3 жыл бұрын
@@Breyyne I made the switch to TryGetCurrent3DRaycastHit. I am sending the request. My Update function looks like this: void Update() { if (!_isActive) return; if (_thumbstick.triggered) return; if (!rayInteractor.TryGetCurrent3DRaycastHit(out RaycastHit hit)) { rayInteractor.enabled = false; _isActive = false; return; } TeleportRequest request = new TeleportRequest() { destinationPosition = hit.point, //destinationRotation = , }; provider.QueueTeleportRequest(request); rayInteractor.enabled = false; _isActive = false; }
@ArendRaifsnider3 жыл бұрын
@@Breyyne Turns out it is working but not as expected. When I press the stick forward, the ray comes out but doesn't teleport me. If I hold the grip down and then push the stick forward, the ray comes out and teleports me.
@JustinPBarnett2 жыл бұрын
Join the discord if you're still having issues and we can help you troubleshoot!
@ctedin12 жыл бұрын
I inadvertently updated the XR Interaction Toolkit to the latest version (2.0.1). Typical newbie mistake. Ignored the warning that it was going to break the project. I could have used Collab to go back to the original version, but thought it might be interesting to fix the breaks that happened. The XRI Default Input Actions are very different. It broke the navigation on the left hand totally, although the right turn was still working nicely. Still testing a few more changes. I'll try to post them here and on the Discord. Has anyone tried this 2.0.1 version yet?
@EchteTuber2 жыл бұрын
I ran into the same issue. The ActionMap has changed with the update. Use these instead in the c# script: var activate = actionAsset.FindActionMap("XRI LeftHand Locomotion").FindAction("Teleport Mode Activate"); var cancel = actionAsset.FindActionMap("XRI LeftHand Locomotion").FindAction("Teleport Mode Cancel"); _thumbstick = actionAsset.FindActionMap("XRI LeftHand Locomotion").FindAction("Move");
@JustinPBarnett2 жыл бұрын
If you're still having issues join the Discord and we can help you troubleshoot in #dev-help!
@XxXSkidXxX2 жыл бұрын
@@EchteTuber This worked! You are a genius
@alo2a7eta2 жыл бұрын
Thanks for the great tutorial. I have a weird behaviour on my project. the teleportation is a bit far than expected although the teleportation area is not that wide. do you know what might be the reason for that?
@JustinPBarnett2 жыл бұрын
You can decrease the length of the raycast if you don't want the player to teleport as far
@CrossTwnAuto2 жыл бұрын
Hi Justin, i was trying to setup the teleportation and i am using a plane because i made a room in probuilder and inverted the uvs of a cube to make it so i can't use it for the teleportation zone. when i press the trigger to move and then release to choose where i want to teleport i shoot across the room and im unable to get to a specific location like in the middle of the room can you try help? thanks!
@wscreamer2 жыл бұрын
Hi Justin, I've solved the issue you have with the teleportation rotation in the video. But I'm not fully sure how to send you an email or message. Please let me know how to followup or I can explain in the comments.
@JustinPBarnett2 жыл бұрын
Just shoot me an email or a message in the Discord!
@tannersmith80502 жыл бұрын
Hey Justin. Any recommendation for if we'd like to track the number of times a user has teleported using the Locomotion System? I tried adding code to the base Teleportation Provider, but that ended up being immutable and reverting. If I wanted to create a TeleportationManager script like you did, how would I determine when my new "teleportationCount" variable would need to be incremented? (i.e. how could I track when the XR Origin was successfully teleported.) Thanks in advance!
@JustinPBarnett2 жыл бұрын
You'd have to override the teleport method and add a counter to it
@yasarbaba24133 жыл бұрын
Hi Justin! I want to be teleported with the XR Interaction Toolkit using a button. (where ı want) It doesn't happen when I call TeleportAnchor for the button. How can I do it?
@JustinPBarnett3 жыл бұрын
You'll have to call the teleport provider when your button is pressed and provide a location to be teleported to
@yasarbaba24133 жыл бұрын
@@JustinPBarnett Thank you💥
@EchteTuber2 жыл бұрын
Looking forward to your updated video. Followed the this tutorial and manipulated it to my liking. But the right hand controller is still active too! It teleports on grip release, which is super annoying because I'm using the right controller to interact with grabbables. If I don't point at a grabbable I get teleported. In the XRI RightHand Locomotion action map I removed all the Bindings from the Actions (Teleport Select, Teleport Mode Activate and Teleport Cancel) in the XRI Default Input Actions...
@JustinPBarnett2 жыл бұрын
Yea definitely need to do an updated one soon
@MEJHarrison3 жыл бұрын
Great video! I'm still having one issue I can't quite solve. Mine seems to teleport immediately even while the joystick is stick being held. Any thoughts on where to look for that? I've double and triple checked the code, but can't track it down.
@JustinPBarnett3 жыл бұрын
Sounds like you're running the teleport action on stick pushed instead of stick released and put back to 0
@MEJHarrison3 жыл бұрын
@@JustinPBarnett Sounds like you're talking about C# code. I've double and triple checked it. Even compared it to some code I found in a post below. The only differences were expected. I'm lost. Here's the bit of code I believe you're referring to. If you're talking about something else, I can't find it. void Update() { if (!_isActive) return; if (_thumbstick.triggered) return; if (!rayInteractor.TryGetCurrent3DRaycastHit(out RaycastHit hit)) {
@MEJHarrison3 жыл бұрын
the _thumbstick variable is defined as: private InputAction _thumbstick;
@MEJHarrison3 жыл бұрын
The _thumbstick variable is set here: _thumbstick = actionAsset.FindActionMap("XRI LeftHand").FindAction("Move"); _thumbstick.Enable();
@MEJHarrison3 жыл бұрын
@@JustinPBarnett One last thing occurred to me. I recently followed a different tutorial. Setup a sphere. I could grab it with the left or the right controller. Worked perfectly. I could hold it with my left controller and grab it with my right controller. But, I couldn't hold it with the right and grab it with the left. I watched the video 2-3 times, spent hours trying to figure it out and finally gave up. Now this issue. Might there be something else going on here? Could it be at this point in time it's just a pre-release bug with XR Interaction Toolkit? That's two unexplainable (to me) bugs with the left controller now.
@Frowdy3253 жыл бұрын
HI, Great tutorial. Everything works fine in unity itself, but when i build it to android device (quest2) it doesn't work correctly. When i'm pushing the thumbstick forward it teleports right away, without releasing the thumbstick. Any idea what the problem is?
@ChristianSasso3 жыл бұрын
Try this: if (_thumbstick.ReadValue() != Vector2.zero) return; // if (_thumbstick.triggered) // return;
@danielgarciagonzalez23913 жыл бұрын
@@ChristianSasso This fixed it for me. thank you!
@JustinPBarnett2 жыл бұрын
👆
@joeysmith34652 жыл бұрын
how do you setup project using xr interaction toolkit 2.0
Hello Justin, Thank you for this amazing tutorial! One question though, because I am a complete beginner to coding: in visual studio 2019, although the predictions work, the visuals are different to your in the tutorial. is there some integration settings that I have to implement in my options?
@JustinPBarnett2 жыл бұрын
The code editor I use is JetBrains Rider, so it'll look a little different
@austincottle6789 Жыл бұрын
@@JustinPBarnett based
@sakunamadushanka63822 жыл бұрын
Hi Justin, Thank you for the great tutorial. This have an small issue, When you try this on a plane without "Teleportation Area" Script attached, instead include teleportation anchors, movement is bit weird and it does teleport within that plane without the "Teleportation Area" script. Also this does cause positioning issues when we teleport into anchors. Can you suggest solution to fix this? Thank you in advance!
@JustinPBarnett2 жыл бұрын
Teleporting onto anchors will move the player to that exact spot. It's different than a teleportation area. If you're still having issues join the Discord and we can help you troubleshoot in #dev-help!
@andreigtx17112 жыл бұрын
Hello Justin! I am currenty using your tutorials for my bachelor's degree and I have a problem with this part. I followed your tutorial to animate hands beforehand and after doing this tutorial my rays do not cast anymore and I cannot teleport. Is there any solution for this, or did I mess up something? I am also seeing that my Line Renderer associated to my controller automatically disables itself when I enter play mode. Thanks in advance!
@jack87503 жыл бұрын
In regards to directional teleporting, you might find an answer by seeing how Oculus implemented it in their Unity integration. This tutorial implements what you're describing: kzbin.info/www/bejne/qGLOd2OGndyEbqc
@JustinPBarnett3 жыл бұрын
Ooo thanks! Definitely going to look into this
@jack87503 жыл бұрын
I should mention that while mathematically the magnitude of the thumbstick pressing against the socket is equal to 1, in practice the number might be smaller (0.99 for example). The same goes for the center being point (0,0). You may want to use inequalities in the if statements to allow for a deadzone and a tolerance for the thumbstick.
@ctedin12 жыл бұрын
That video uses the older OVR system. And, it's from 2019. I'm not sure it will be supported in the future.
@olivername Жыл бұрын
That’s not new one there a new one with 5 on there now
@JustinPBarnett Жыл бұрын
Oh I highly recommend the new version now instead of this video. This one is outdated
@olivername Жыл бұрын
@@JustinPBarnett I still can,t get the teleport to work with controller on new input system I tried changing the code when I turn off teleport controller it works but I want to turn off by button
@westparezal3 жыл бұрын
2018-we teleported with basic animation, beautiful spline and round point model for it... 2021... wtf man?))
@JustinPBarnett2 жыл бұрын
ask Unity 🤷♀️
@icarinamali3 жыл бұрын
Not for beginners. This tutorial goes way too fast and is not very clear.
@JustinPBarnett3 жыл бұрын
Did you watch this video first?? kzbin.info/www/bejne/Z4emZI2FrdNlgtE
@Kiddrelax2 жыл бұрын
Amazing video, I had the same problem as some people that the trigger wasnt working correctly, changed to: if (_thumbstick.ReadValue() != Vector2.zero) return; And it worked just fine. Another problem was the teleport was going too far away but I figured that the teleportation was being activated more than once so after I do the TeleportRequest I just added this two lines: provider.QueueTeleportRequest(request); rayInteractor.enabled = false; _isActive = false; Hope this helps someone :)