Godot: func _process(_delta) should be default preset instead of func _process(delta)

Created on 8 Apr 2019  路  3Comments  路  Source: godotengine/godot

Godot version:
3.1 stable

Issue description:
func _process(delta) results in a warning, func _process() is not possible
Hence func _process(_delta) should be the default preset.

When a new user adds a default script to a node the first time, they should not get a warning.

discussion enhancement editor gdscript

Most helpful comment

I disagree too.

The proper solution IMO is what I proposed in https://github.com/godotengine/godot/issues/27576#issuecomment-478745395 i.e. split this warning into two warnings:

  • One for user-defined methods (ON by default), so my_method(arg_i_wont_use) will raise a warning
  • One for engine callbacks (OFF by default), so _process(delta) won't raise a warning unless you enabled this warning yourself

All 3 comments

I disagree, variables shouldn't be "ignored" by default and I think it's the user's job to choose to put the underscore when desired.

I disagree too.

The proper solution IMO is what I proposed in https://github.com/godotengine/godot/issues/27576#issuecomment-478745395 i.e. split this warning into two warnings:

  • One for user-defined methods (ON by default), so my_method(arg_i_wont_use) will raise a warning
  • One for engine callbacks (OFF by default), so _process(delta) won't raise a warning unless you enabled this warning yourself

The proper solution IMO is what I proposed in #27576 (comment) i.e. split this warning into two warnings:

One for user-defined methods (ON by default), so my_method(arg_i_wont_use) will raise a warning
One for engine callbacks (OFF by default), so _process(delta) won't raise a warning unless you enabled this warning yourself

Yes, this sounds like a much better solution!

Was this page helpful?
0 / 5 - 0 ratings