Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Detect when user teleports to an anchor (and not just move there)

Discussion in 'AR/VR (XR) Discussion' started by AnahidE5, May 26, 2022.

  1. AnahidE5

    AnahidE5

    Joined:
    Jan 10, 2022
    Posts:
    40
    Users can move (using thumbstick) or teleport to different positions in the environment. I want to change their rotation to face the attraction only when they teleport to an anchor. I was thinking about using colliders and onTriggerEnter, but I don't want the rotation "correction" to happen if the users just walk or move there, only when they teleport there. Is there like a specific event that happens in teleport that i can use?
    Thank you.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,312
    I don't know, it's your teleport code... is there an event?? :)

    If not, then hook one into whatever triggers what you call a teleport.

    Remember: nothing in a computer moves smoothly. It's an optical illusion.

    EVERYTHING technically teleports every frame.

    Teleport usually just means "a noticeably big move in one frame."
     
  3. AnahidE5

    AnahidE5

    Joined:
    Jan 10, 2022
    Posts:
    40
    Oh I see.. I realized I asked my question again as if everybody knows what's happening in my app. I am using the teleport function and teleport anchors provided by XR interaction toolkit 2.0.1. I was wondering if there is similar to "hoverEntered" that I can use. I could probably find a better part of the forum to post this too. :(
     
  4. AnahidE5

    AnahidE5

    Joined:
    Jan 10, 2022
    Posts:
    40
    For future readers: Teleport anchor in the inspection has settings that you can control including "Match Orientation". Working on tight deadlines means I don't pay attention as much as I should o_O
     
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,312
    Sounds like this would be better suited to the AR/VR/XR group as it is an API that few of us ever see.

    I have reported your post, hopefully a mod will whip it over there!