Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question How to check if Sphere Collider is fully in other collider | VR-Game

Discussion in 'VR' started by c132magnet, May 17, 2024.

  1. c132magnet

    c132magnet

    Joined:
    Oct 30, 2023
    Posts:
    1
    Hello,
    I am currently making a VR game and I have set everything up just right.

    PROBLEM:
    The hands of the player have sphere colliders and I want a script (on each hand induvidualy) to check if the sphere collider is complitly inside a different collider.

    WHAT I ALREADY HAVE TRIED:
    - On Trigger enter/exit - as soon as the sphere collider is complitly in the other collider it just "runs" on trigger exit.
    - Raycasts and Sphere Raycasts - when the sphere collider is in the other collider it just doesnt notices the other collider

    INFO:
    Editor Version: 2021.3.30f1
    The other collider is not specific like it can be any collider. And I want to do it with a layer mask...
    And I want to make a movement system kinda like Gorilla Tags but I want you to have to grab inside a wall to hold onto it, so also if the collider isnt fully in the object it should also work.

    Sorry for my bad english, I am german ;)
    Thanks