• Godot Help
  • I need the z and y mouse position in the 3d workspace for a tool

Hi everyone,

I'm currently learning coding with godot.
After a fast start with good progress, I have some trouble with the tool / EditorPlugin mechanics.

I know there are already some terrain creation plugins, but I try to create a simple terrain plugin (for learning purposes).

Creating a random terrain in a custom node and saving the heightmap as a png was easy.
Editing the heightmap after it's creation with gdscript was easy too.

But now I want to edit the highmap within the 3d workspace.

For this, I want to get the mouse position. I tried it for a few days.

I found some interesting Posts.

For example:
https://godotengine.org/qa/25922/how-to-get-3d-position-of-the-mouse-cursor

But I can't solve the problem. Maybe I misunderstood something.

I tried it with Collision Objects. It works in the started scene, but not in the editor.

And I tried it with raycasting on a Plane, and many more.

I would be really happy for your help.

Thank you!

    Hi Tomcat,

    thank you.

    I tried it already with the tool mode.... maybe false

    _process -> works
    _on_Area_input_event -> works not
    _on_Area_mouse_entered -> works not
    _input -> works not

    By logic (description) this mode should do in the editor what happens in the running scene. More I unfortunately can not tell you. But if you want to lay out the code of the project, then highlight the top and bottom ```.