Inputs not working

Hello,

I’m new a Godot and I’m trying to implement a zoom in and out function.
I have tried many tutorials, all not working and for my last try, I have the following:

A Node2D with a Camera2D with the following script:

extends Camera2D

var ZoomSpeed = Vector2(0.1,0.1)

func _ready() -> void:
	print("Camera script is running")
	pass

func _input(event):
	print("DED")
	if event is InputEventMouseButton:
		if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
			print("Left button was clicked at ", event.position)
		if event.button_index == MOUSE_BUTTON_WHEEL_UP and event.pressed:
			print("Wheel up")

The Camera scripti is running is displayed, but nothing is displayed from _input. What do i miss?

Hi, I copied and pasted your script and it works:

Could you share a bit more info? Like your node hierarchy or something?

I simply solved it by restarting godot… It works after without changing anything. Thanks anyway

1 Like

Haha, well a good old reboot is always something to try.
Glad it now works.