Hello everyone.







Unactive collision on cursor

i'm new to Hololens Developement and i wonder if there is any way to make the cursor don't interact (or interact only ) with some collider. Like a systeme of tag for exemple, i use the Default cursor from the HoloToolkit but i can use any other.

To Clarify my probleme : I have cubes with collider (bigger than their size) and spheres with collider too. But when a cube is near a sphere i can barely interact with the sphere that's why i would like to make every cube collider "un-interactable" by the cursor but not by other collider.




  • dbarrettdbarrett ✭✭✭

    Take a look at Layer-based collision detection.


    AR Developer

  • thanks i'll check that !
    Sorry for the long time i was working on another project.

  • You could also try deleting the box collider and having a mesh collider on your object, I think mesh colliders are typically tighter to the shape of the object

  • @dbarrett. The idea seemed good but i could'nt make it work, the cursor keep interacting with every collider. I've read a post where someone was talking about a collider mask who overide the matrix but i couldn't find it.

    @Xandros221. I unsterand what you're saying but i can't do that. The collider must be bigger than the mesh and work like a zone to trigger the hololens but i don't want the cursor to collide on it

    I keep searching, thx both of you.

  • I think the matrix you heard of is accessible via Edit > Project Settings > Physics

    You can also do a raycast with a layermask:
    RaycastHit hit;
    if (Physics.Raycast(Camera.main.transform.position, Camera.main.transform.forward, out hit, Mathf.Infinity, 1 << LayerMask.NameToLayer("name of the layer you want to hit"))
    // put cursor object at hit point
    yourCursorGameObject.transform.position = hit.point;

Sign In or Register to comment.