Hi everyone. It's tough coming up with an apt title for this one.
I have multiple scenes with a RigidBody2D as the main node, then a Sprite and a CollisionShape2D
In my main scene I have several of these instantiated. In the script for each of them, I use _on_NodeName_input_event to detect the mouse being pressed and held down then I have code to move it with the mouse cursor or rotate it if it's the right mouse button.
My question is, since all the code is the same for each one, is there a way to detect if the mouse has been pressed on any of them in the main scene's script instead and then apply the mouse dragging and or/or rotating from there rather than having the same code in every script for every object?
like on_childX_input_event(body):
if left mouse button down do this to childX etc.
Any help would be most appreciated as always.