I am working on a top down 3D 3rd person game with point and click elements in Unity 5. I am trying to figure out the best way to do a context sensitive radial/pie menu that will appear where the user right clicks in the scene (sort of the way the Sims series works or old school point and click adventures). I’m wondering if someone has done a similar control and if they followed one of the two paths below or a third option?
My first thought was to set a panel in World Space mode which would contain the buttons and then parent/bind that to an empty game object which could be moved to where the user clicked , this would allow the menu to stay affixed to the item the user clicked on, in case they pan the camera after bringing up the menu. The problem here is that trying to find a uniform distance from the object to avoid clipping issues or being obscured by other objects and avoiding the menu being drastically larger or smaller because it is closer/further from the camera due to the object distance or camera zoom. (I am currently using Perspective mode, and would prefer to not move to Isometric)
My second thought was to use the Screen Space overlay mode and reposition the panel on the canvas using ray tracing to determine the correct position over the object in the game world but then if you pan the camera after clicking the menu would stay wherever it was on the screen without working some magic that is beyond my current skill level.
I’ve searched several times for tutorials on this type of situation but I haven’t found anything that uses the UI system introduced in 4.6 ( I am currently using Unity 5)