How to make a spatial instance follow the mouse?

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

In godot I want to create an instance of a cube during runtime and have it follow the mouse. However loads of cubes are created instead of just one, Any help?

Screenshot:
enter image description here

:bust_in_silhouette: Reply From: Basil

Fixed used _ready instead of _process