Simulate a mouseclick per code

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Godot_Starter

Is there a way how I can simulate a mouseclick per code, so there is no real mouseclick but it is dealt like a mouseclick on a specific position. (in a 2d game)

For example: I want to simulate a left mouse button click on the position Vector2(500,500). And if there is a button it gets pressed exactly how it would be when I press there with the real mouse.

IMHO this question is good guidance on your problem. Organizationally all mouse clicks should just call a single function, so you should be able to call that function from elsewhere without a mouse click.

DDoop | 2020-07-17 22:06