Search Unity

How to select a 3d line or point in the editor

Discussion in 'Editor & General Support' started by mahdiii, Dec 12, 2020.

  1. mahdiii

    mahdiii

    Joined:
    Oct 30, 2014
    Posts:
    856
    Hi. How can I select a 3d line or point (handles) in the editor?
    I have used HandleUtility.GUIPointToWorldRay. It is OK for 2d space or projected space like x-z but I want to select elements in any view direction.

    To find the target point or line, I compute the distance between the mouse position (world space) and all elements and get the index with min distance, finally checking with some threshold