Tuesday, December 1, 2015

unity - Unity3d select empty gameobjects in scene


I have a pathing system that I am creating in Unity. When you add nodes to denote the path, I create a empty GameObject and render it in OnGUI as a square. The problem that I have is clicking on the object in the scene view. I am trying to figure out what would be the best way to click the Node, so that I can move and rotate the Node.


I had some ideas, like:





  1. Creating a Cube or some other GameObject with a mesh, and change the layer to Node. Then make the camera cull out the Node layer.




  2. Only in editor mode, create a temp asset and delete it before runtime.




  3. Do a raycast and see what objects are near the click, then pick the closest one.





I have a feeling that I am putting to much thought into it, and suggestions would be greatly appreciated!!




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...