W 0:00:03:0774 The signal "pause_options" is declared but never explicitly used in the class. <GDScript Error>UNUSED_SIGNAL <GDScript Source>pauseoptions.gd:3

extends Control

signal pause_options

func _ready():
pass

func _on_go_back_pressed():
emit_signal(“pause_options”)
queue_free() # Remove the pause menu

func _on_volume_pressed():
get_tree().change_scene_to_file(“res://scenes/pausevolume.tscn”)

player.gd

extends CharacterBody2D

const SPEED = 130.0
const JUMP_VELOCITY = -300.0

Get the gravity from the project settings to be synced with RigidBody nodes.

var gravity = ProjectSettings.get_setting(“physics/2d/default_gravity”)

@onready var animated_sprite = $AnimatedSprite2D

func _physics_process(delta):
# Check for pause menu input
if Input.is_action_just_pressed(“pause_options”):
_pause_game()
return # Stop further processing while paused

# Add the gravity.
if not is_on_floor():
	velocity.y += gravity * delta

# Handle jump.
if Input.is_action_just_pressed("jump") and is_on_floor():
	velocity.y = JUMP_VELOCITY

# Get the input direction: -1, 0, 1
var direction = Input.get_axis("move_left", "move_right")

# Flip the Sprite
if direction > 0:
	animated_sprite.flip_h = false
elif direction < 0:
	animated_sprite.flip_h = true

# Play animations
if is_on_floor():
	if direction == 0:
		animated_sprite.play("idle")
	else:
		animated_sprite.play("run")
else:
	animated_sprite.play("jump")

# Apply movement
if direction:
	velocity.x = direction * SPEED
else:
	velocity.x = move_toward(velocity.x, 0, SPEED)

move_and_slide()

func _pause_game():
# Pause the game
get_tree().paused = true

# Load the pause menu scene
var pause_scene = preload("res://scenes/pauseoptions.tscn").instance()
get_tree().get_root().add_child(pause_scene)

# Connect the "resume_game" signal from the pause menu to the _resume_game function
if pause_scene.has_signal("pause_options"):
	pause_scene.connect("pause_options", self, "pause_options")

func _resume_game():
# Resume the game
get_tree().paused = false

signal pause_options

func _on_go_back_pressed():
     emit_signal(“pause_options”)
     ......

I am guessing a bit here, but because that is the old way of emitting a signal, I think the engine is not recognising that string as the signal. I believe this method was kept just for backward compatibility, but will probably be dropped sometime in the future.

The new way is simply:

pause_options.emit()

Now when this first changed I was not a fan, but after a few weeks I have to say I was wrong. The new way has so much more going for it in terms of readability and usability that I now look at the old way like “huh, did we really used to do that?”. You can read about it here.

I think this will remove your warning notice.