Hello,
I am new to Godot (fluent in python) and I am trying to write my first game. It's a simple physics puzzle game in which you click on some objects and they disappear/get destroyed. After making my research I understood that RigidBody2D was the way to go since it has built in physics. However I can not detect the input on my objects. Following a tutorial, I added a custom item in Input Map: uitouch with left mouse button. I make the object pickable in the inspector then I connect the inputevent of my object to itself and write the following code but nothing happens: (I'm using Godot 3.2.1)
extends RigidBody2D
func ontest1inputevent(viewport: Node, event: InputEvent, shapeidx: int) -> void:
if event is InputEventMouseButton:
if event.is_pressed():
print("Object clicked")
Thank you in advance.
Note: The indentation is correct in my code