These tutorials have been SO helpful!! For anyone who can't teleport, or you teleport instantly without releasing the thumbstick, I have two fixes: 1) If you try to teleport but nothing happens: It seems like the XRI Default Input Actions "Action Maps" names have updated from "XRI LeftHand" to "XRI LeftHand Locomotion" in newer versions of Unity, and so the code needs to match. Around lines 50 - 60, there are three lines that use FindActionMap() and need to be updated to have the " Locomotion" added. Example: inputAction.FindActionMap("XRI" + targetController.ToString() + " Locomotion"). Then you should be able to teleport! 2) If you teleport instantly upon pressing the thumb stick down: Go to void Update() and make the third if statement read: if (_thumbstickInputAction.IsPressed()). And then you should be able to hold the thumb stick down, release, and then teleport!
@@olivername Same here -- when I push the stick forward, the rays show up, but in red, as if it's not recognizing the position of (or not colliding with) my locomotion area
@FistFullofShrimp - UPDATE - Jul 31 2023 Through debug logging, I found that the script does not get past the point: if (!_teleportIsActive) { ... } Do you have any ideas where we could start looking to fix this? Thx in advance!
Tried this teleportation method and it's working great in the editor, but in the android build, teleportation happens immediately when I press the joystick. Any Idea how to fix this?
I'm having an issue, the ray is visible only for 0.5sec and teleport me instantly to the location, it is not waiting for me to release the joystick. Same is happening if no teleportable plane is found, ray just disappear after 0.5 sec.
I'd check out the Teleportation Controller script on you Left and Right Teleporting Rays. Make sure the Target Controller is set to Left/Right correctly.
@@FistFullofShrimp Thanks for replying. After rechecking, I got to know that I added the collider to reticle, so when reticle appeared, the ray thought that I am pointing to non teleportable layer, hence the cycle repeats. So I removed the collider and problem is solved.
Great tutorials mate! - I am struggling for a reliable way to teleport to an ANCHOR via a script call instead of by teleportion interactor. The idea is to be able to call series of teleports to anchors over time. Imagine a timeline based tour system that walks you through a scene as it narrates. My simple theory is to be able to request an ANCHOR teleport but I have no idea how to implement this. The Telport Anchor is perfect as it orientates the player correctly. Do you have any suggestions? Thanks very much!
this is a great video as always! i have one question though, how do you limit the input action to just the forward direction on the thumbstick? i seem to only be able to do the y-axis as a whole so forward and back both initiate the teleport. idk what im missing and unity's new input system is still pretty confusing for me
The new input system screws me up as well. I definitely see the benefits too it, but it does take some getting used to. As for your question, you should be able to find the limiting factor if you open up the XRI Default Input Actions. Select XRI LeftHand, find and expand the Teleport Mode Activate action, and select Primary2DAxis. On the right hand side you'll see something that says Directions = North. This is pretty much telling the action to only activate when the directional pad is pushed north(up). You may also want to read up on Sweep Behavior depending on how you want your teleport to cancel. The XR Interaction Toolkit sets it to Locked by default, but you might prefer a different mode. Here's a link if you want to read up on that. docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@0.10/api/UnityEngine.XR.Interaction.Toolkit.Inputs.Interactions.SectorInteraction.SweepBehavior.html Hope this helps! Cheers!
The approach I would take would involve adding two Events in the Teleportation Controller Script. One Event would be for when the Teleporting system is active and another for when it is inactive. Then I'd have the Script for the Ray Interactors listen for those events and turn off during Teleportation being active and on when Teleportation is inactive. Hope this helps!
@@FistFullofShrimp It does - thank you. I implemented something similar by activating/ deactivating Teleporting depending on the button input. It does work but not 100% reliable,, which events would you choose?
hey there, your videos are really helpful. Everything has been working great so far. However, I do have a problem now. I followed evertying till 16:40 but I always get the following error: "NullReferenceException: Object reference not set to an instance of an object" at line 52 and 68. I'm kinda new to C# and Unity so I'm really struggling there. Anyway, keep up the good work! I'm always so excited when a new video comes out.
Thanks for the kind word! Now lets see if we can figure this out. If it's giving you a NullReferenceException, it means we haven't set the variable. Specifically, line 52 is trying to look up the action map for "Teleport mode Activate". It does this by using the public variable on line 25 that is a InputActionAsset variable called inputActions. The most likely thing going on is that this variable isn't set and so when it tries to lookup the action map associated with it, it can't find anything and sets it to null. To fix this, head back to the editor and make sure the InputAction variable is set for the left and right controller. An example can be found in the video at this timestamp. czcams.com/video/q1HuVUdq9ps/video.html Hope this fixes it!
This is great tutorial. It would be awesome to be able to do continuous movement and teleportation at the same time. A Township Tale does this by using the primaryButton to start the teleportation and then releasing the primaryButton finishes the teleportation. I tried doing this but I don't know how to grab the primaryButton release action. Let me know if you have any ideas.
I have a very strange situation, I have to press the grip button first, then push the tumpstick, and then release the grip to teleport. If I push the tumpstick first and press the grip, the ray of the teleport will disappear, and the teleport will be invalid.
Your tutorial really helped me out, but I have a little problem and I don't know how to fix it. When I use the teleportation, the player immediately moves to the new position instead of waiting until I release the thumbstick. Can anyone help me?
Works great. Altough every frame that I try to teleport (hold the tumbstick down) I get a error that leads me to the " if (!rayInteractor.enabled) return" (At 14:36 - Line 84) Does anyone know why this happens and how to fix it?
My first guess would be that the rayInteractor hasn't been set in the editor and so when it is checking if it's enabled, it's referencing an empty variable. Make sure to check your right and left ray teleports in the editor and see if they have their rayInteractors set. Cheers!
thank you for this awsome tutorial, but i have a problem when i teleport my camera atltidude changes when i start the project the camera is in the right altitude but when i teleport it goes to the floor level. anyway keep up the good work
If this problem pertains to the Teleportation Anchor, try checking it's transform and the transform associated with it's Anchor child object. Also check the setting of the Match Orientation in the Teleportation Anchor script area. You might have accidently set value(s) differently than the values shown in the video, which work fine for me.
i had only one problem with this! The videos are incredible, and i thank you very much for your help! I have a plane around my teleportation zone , and when I try to teleport to it, it puts me at the origin of the plane gameObject. I'm unsure of how to rectify this, because i don't want to be able teleport there :P Any help is much appreciated :)
Thanks for your videos! The instructions are very clear and inspiring for those who is not so familiar with c#! :) I am trying to work on the script part, the teleport ray is not working whenever the script is enabled. I saw another comment from Nad but my log is slightly different," NullReferenceException: Object reference not set to an instance of an object TeleportationController.OnDestroy () (at Assets/Scripts/TeleportationController.cs:69)" Do you have any idea? Thanks a lot!
In case someone encountered the same issue: The input action map may be slightly different (In my case: XRI is split into RightHand, RightHand Locomotion, and RightHand Interaction) so that the script cannot reference the action maps. To solve it, just simply drag the actions from locomotion to the right column! The detailed comment lines and the video really helps me solve this. I really appreciate your work and thank you soooooo much!
@@hardman7235 When you open the "XRI Default input Actions" menu, there are Action maps on the left (tagged yellow) and Actions in the middle (tagged green). Select all the teleport-related actions and drag to the corresponding Action Maps on the left, then it should be working!
@@loBokyin1006 I got the issue where teleport works in you take off the script the teleport works but I think thats my issue too won't turn off by controller because of new input system
These tutorials have been SO helpful!! For anyone who can't teleport, or you teleport instantly without releasing the thumbstick, I have two fixes:
1) If you try to teleport but nothing happens: It seems like the XRI Default Input Actions "Action Maps" names have updated from "XRI LeftHand" to "XRI LeftHand Locomotion" in newer versions of Unity, and so the code needs to match. Around lines 50 - 60, there are three lines that use FindActionMap() and need to be updated to have the " Locomotion" added. Example: inputAction.FindActionMap("XRI" + targetController.ToString() + " Locomotion"). Then you should be able to teleport!
2) If you teleport instantly upon pressing the thumb stick down: Go to void Update() and make the third if statement read: if (_thumbstickInputAction.IsPressed()). And then you should be able to hold the thumb stick down, release, and then teleport!
Thank you so much, I was desperate already.
Thank you very much.
I got the new input system and try this but nothing is working with teleport and put the code on both rays
@@olivername Same here -- when I push the stick forward, the rays show up, but in red, as if it's not recognizing the position of (or not colliding with) my locomotion area
@FistFullofShrimp -
UPDATE - Jul 31 2023
Through debug logging, I found that the script does not get past the point:
if (!_teleportIsActive) { ... }
Do you have any ideas where we could start looking to fix this? Thx in advance!
Always love your videos. You deserve a big recognition my man
I really appreciate you saying so. Hope to get more great content out soon! Cheers!!!
Yes. Great stuff. Thanks and subbed.
Tried this teleportation method and it's working great in the editor, but in the android build, teleportation happens immediately when I press the joystick. Any Idea how to fix this?
🥲the same
I made sure I followed all the steps and whenever I first try to test it, it doesn’t teleport but idk what’s going on
Great! Thank you so much!
I'm having an issue, the ray is visible only for 0.5sec and teleport me instantly to the location, it is not waiting for me to release the joystick. Same is happening if no teleportable plane is found, ray just disappear after 0.5 sec.
I'd check out the Teleportation Controller script on you Left and Right Teleporting Rays. Make sure the Target Controller is set to Left/Right correctly.
@@FistFullofShrimp Thanks for replying. After rechecking, I got to know that I added the collider to reticle, so when reticle appeared, the ray thought that I am pointing to non teleportable layer, hence the cycle repeats. So I removed the collider and problem is solved.
you are the best🥰. I can't wait ! . Please make next part 😍
Just posted it a few minutes ago. Enjoy!
@@FistFullofShrimp thanks 😘
Great Video!
Somehow I get automatically teleported after a small delay?
Can't seem to find the issue :(
Great tutorials mate! - I am struggling for a reliable way to teleport to an ANCHOR via a script call instead of by teleportion interactor. The idea is to be able to call series of teleports to anchors over time. Imagine a timeline based tour system that walks you through a scene as it narrates. My simple theory is to be able to request an ANCHOR teleport but I have no idea how to implement this. The Telport Anchor is perfect as it orientates the player correctly. Do you have any suggestions? Thanks very much!
this is a great video as always! i have one question though, how do you limit the input action to just the forward direction on the thumbstick? i seem to only be able to do the y-axis as a whole so forward and back both initiate the teleport. idk what im missing and unity's new input system is still pretty confusing for me
The new input system screws me up as well. I definitely see the benefits too it, but it does take some getting used to.
As for your question, you should be able to find the limiting factor if you open up the XRI Default Input Actions. Select XRI LeftHand, find and expand the Teleport Mode Activate action, and select Primary2DAxis. On the right hand side you'll see something that says Directions = North. This is pretty much telling the action to only activate when the directional pad is pushed north(up). You may also want to read up on Sweep Behavior depending on how you want your teleport to cancel. The XR Interaction Toolkit sets it to Locked by default, but you might prefer a different mode. Here's a link if you want to read up on that.
docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@0.10/api/UnityEngine.XR.Interaction.Toolkit.Inputs.Interactions.SectorInteraction.SweepBehavior.html
Hope this helps! Cheers!
great staff thx
I'm thinking of making a teleport into the diorama scale down and out of diorama scale up.
09:43 I would indeed be very interested to know how to implement both interaction and teleporation. What is necessary for this?
The approach I would take would involve adding two Events in the Teleportation Controller Script. One Event would be for when the Teleporting system is active and another for when it is inactive. Then I'd have the Script for the Ray Interactors listen for those events and turn off during Teleportation being active and on when Teleportation is inactive. Hope this helps!
@@FistFullofShrimp It does - thank you. I implemented something similar by activating/ deactivating Teleporting depending on the button input. It does work but not 100% reliable,, which events would you choose?
hey there, your videos are really helpful. Everything has been working great so far.
However, I do have a problem now. I followed evertying till 16:40 but I always get the following error: "NullReferenceException: Object reference not set to an instance of an object" at line 52 and 68. I'm kinda new to C# and Unity so I'm really struggling there.
Anyway, keep up the good work! I'm always so excited when a new video comes out.
Thanks for the kind word! Now lets see if we can figure this out.
If it's giving you a NullReferenceException, it means we haven't set the variable. Specifically, line 52 is trying to look up the action map for "Teleport mode Activate". It does this by using the public variable on line 25 that is a InputActionAsset variable called inputActions. The most likely thing going on is that this variable isn't set and so when it tries to lookup the action map associated with it, it can't find anything and sets it to null.
To fix this, head back to the editor and make sure the InputAction variable is set for the left and right controller. An example can be found in the video at this timestamp.
czcams.com/video/q1HuVUdq9ps/video.html
Hope this fixes it!
@@FistFullofShrimp yup that was it. Thank you so much! :)
@@nad1314 Glad I could help! Happy learnings
@@FistFullofShrimp I check this but still got it
This is great tutorial. It would be awesome to be able to do continuous movement and teleportation at the same time. A Township Tale does this by using the primaryButton to start the teleportation and then releasing the primaryButton finishes the teleportation. I tried doing this but I don't know how to grab the primaryButton release action. Let me know if you have any ideas.
can you pls show how to do gorilla tag type movement i love your vides and they have really helped
I have a very strange situation, I have to press the grip button first, then push the tumpstick, and then release the grip to teleport. If I push the tumpstick first and press the grip, the ray of the teleport will disappear, and the teleport will be invalid.
Does anyone know how to teleport with orientation with XRToolKits?
can you make a ui system that allows us to change between teleportation and continuous movement and snap turn and continuous turn
Your tutorial really helped me out, but I have a little problem and I don't know how to fix it. When I use the teleportation, the player immediately moves to the new position instead of waiting until I release the thumbstick. Can anyone help me?
in the update() method, into the third if statement change _thumbstickInputAction.triggered whit _thumbstickInputAction.IsPressed()
this code still does not work for me
When we come to the end of the video, the teleport anchor does not work
Also, when we hold the ball, our hands are hidden. This was not in previous videos. Which setting do we turn on, hands appear?
@@RobotçuDayı This was actually in the last video he did 😬
Works great.
Altough every frame that I try to teleport (hold the tumbstick down) I get a error that leads me to the " if (!rayInteractor.enabled) return" (At 14:36 - Line 84)
Does anyone know why this happens and how to fix it?
My first guess would be that the rayInteractor hasn't been set in the editor and so when it is checking if it's enabled, it's referencing an empty variable. Make sure to check your right and left ray teleports in the editor and see if they have their rayInteractors set. Cheers!
@@FistFullofShrimp thanks for the replay. I had already done that and it all works just fine. Just 200+ errors that seemingly do nothing though
I think you left out the _thumbstickInputAction.Enable(); statement
You know what? You're 100% correct. Thanks for letting me know so I can update the github project. Cheers!!!
where do I put that
thank you for this awsome tutorial, but i have a problem when i teleport my camera atltidude changes when i start the project the camera is in the right altitude but when i teleport it goes to the floor level.
anyway keep up the good work
If this problem pertains to the Teleportation Anchor, try checking it's transform and the transform associated with it's Anchor child object. Also check the setting of the Match Orientation in the Teleportation Anchor script area. You might have accidently set value(s) differently than the values shown in the video, which work fine for me.
i had only one problem with this! The videos are incredible, and i thank you very much for your help!
I have a plane around my teleportation zone , and when I try to teleport to it, it puts me at the origin of the plane gameObject. I'm unsure of how to rectify this, because i don't want to be able teleport there :P Any help is much appreciated :)
Ah.. never mind.. i forgot to put a return: on line 97.. If anyone has this issue check this haha
hi Fist Full of Shrimp I have an issues where line reader is not always in my hand keeps being in middle any help would be great
same cant fix it either
Thanks for your videos! The instructions are very clear and inspiring for those who is not so familiar with c#! :)
I am trying to work on the script part,
the teleport ray is not working whenever the script is enabled. I saw another comment from Nad but my log is slightly different," NullReferenceException: Object reference not set to an instance of an object
TeleportationController.OnDestroy () (at Assets/Scripts/TeleportationController.cs:69)"
Do you have any idea? Thanks a lot!
In case someone encountered the same issue:
The input action map may be slightly different (In my case: XRI is split into RightHand, RightHand Locomotion, and RightHand Interaction) so that the script cannot reference the action maps. To solve it, just simply drag the actions from locomotion to the right column!
The detailed comment lines and the video really helps me solve this. I really appreciate your work and thank you soooooo much!
@@loBokyin1006 could you please elaborate a bit more on what you mean by dragging them to the right column? i'm stuck on this same issue
@@hardman7235 When you open the "XRI Default input Actions" menu, there are Action maps on the left (tagged yellow) and Actions in the middle (tagged green). Select all the teleport-related actions and drag to the corresponding Action Maps on the left, then it should be working!
@@loBokyin1006 I got the issue where teleport works in you take off the script the teleport works but I think thats my issue too won't turn off by controller because of new input system
@@loBokyin1006 I did this but still not working