[EditorWindow] Possible to create raycast on Terrain

Hi,

I’m currently trying to create a small EditorWindow Tool to place Prefabs in a certain radius on a terrain surface.
Is this possible by using a custom EditorWindow?

If yes, how do I get the mouse position to create a ray into the scene and find out where to hit the surface of my terrain?

Currently I just get the MousePosition in OnGUI(), but I need the mouse position in the scene View if the EditorWindow is enabled.

Thanks a lot in advance
L_tD

Hi,

I solved it, because I think I had missunderstand how EditorWindow scripts are working. It did it now the way how it is done in this video.

Maybe it helps others if they want to do the same.

Best
L_tD