I am having some trouble while I was following the documentation tutorial in the category Step by step
I do not understand what the error mesage says. Here is the code

Error line 7: Invalid type in function 'connect' in base 'Signal'. Cannot convert argument 1 from String to Callable.

extends Sprite2D

var speed = 400
var angular_speed = PI

func _ready():
	$Timer.timeout.connect("_on_timer_timeout")

func _process(delta):
	var direction = 0
	if Input.is_action_pressed("ui_left"):
		direction = -1
	if Input.is_action_pressed("ui_right"):
		direction = 1
	rotation += angular_speed * direction * delta

	var velocity = Vector2.ZERO

	if Input.is_action_pressed("ui_up"):
		velocity = Vector2.UP.rotated(rotation) * speed
	
	position += velocity * delta


func _on_button_pressed():
	set_process(not is_processing())

func _on_timer_timeout():
	visible = false

I will appreciate any help.

  • DaveTheCoder and Serhy replied to this.
  • Meternik may be this lines some how will help

    onready var timer= get_node("Timer")
    
    func _ready():
    	timer=Timer.new()
    timer.connect( 'timeout', self, "_on_timer_timeout")

    Meternik I was following the documentation tutorial in the category Step by step

    What is the link to that page? (So that I can tell whether it's a mistake in the tutorial, or if you're looking at the wrong version.)

      Meternik may be this lines some how will help

      onready var timer= get_node("Timer")
      
      func _ready():
      	timer=Timer.new()
      timer.connect( 'timeout', self, "_on_timer_timeout")

      Meternik I tried not to copy paste everything

      Okay, but what's the link (URL) to the tutorial? It looks like you're trying to use Godot 3 code in Godot 4.

        DaveTheCoder Okay, but what's the link (URL) to the tutorial? It looks like you're trying to use Godot 3 code in Godot 4.

        Their comment with the link was stuck in automoderation queue. See above.

        your question directed me on way of resolving my question May be thankful to this tutorial