Is there a way to prevent errors from occurring in the function '_process' without using 'delta'?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Eclair

The following code will cause a yellow error.

func _process(delta):
	if Input.is_action_pressed("ui_cancel"):
		get_tree().quit()

The following yellow error is displayed:

The argument ‘delta’ is never used in the function ‘_process’

Is there a way to prevent errors from occurring in the function ‘_process’ without using ‘delta’?

(v.3.1.beta10.official)

:bust_in_silhouette: Reply From: TyTYctA

You can click onto warning button at bottom left of script edior
enter image description here
then click ignore that warning


the warning will not appear anymore

In earlier versions, I also recognize that a warning button appeared at the bottom of script edior.
However, now I tried it with “v3.1.beta.official”, but it did not come out.

According to your advice, putting the following comment will not cause an error.

#warning-ignore: unused_argument

Your advice has solved the problem!
Thanks to uploading the image, it’s easy to understand.
Thank you so much, TyTYctA! XD

Eclair | 2019-03-04 13:19

:bust_in_silhouette: Reply From: jagc

Use

_delta

instead of delta.

Example:

func _process(_delta):

When you’re sure you’re not using delta.

I got this from this github issue ticket.

I tried the following code using “_delta”.

func _process(_delta):
    if Input.is_action_pressed("ui_cancel"):
        get_tree().quit()

I confirmed that the yellow error was not displayed.
The way Jagc taught me is simple, useful and great!
Thank you so much, Jagc! XD

Eclair | 2019-05-21 06:27