0 votes

Greets!

I often got these kind of yellow error when testin my projects:

'The argument 'body' is never used in the function 'onArea2Dbodyentered''.

They don't seem to really affect them, are they?

in Engine by (325 points)

3 Answers

+1 vote
Best answer

I wouldn't recommend that you blindly ignore warnings. They are there to indicate possible issues with your code. As long as you understand why a given warning is being issued, you can make an informed decision regarding whether it's important to you or not.

The specific warning you mention is just telling you that your onArea2Dbodyentered function has an input argument (body, which is the body you collided with) that you're not using in the function. That's not really a problem if you don't need it for anything. So, again, just understand the warnings and make appropriate decisions.

You can tune the various warnings issued by Godot in the Project Settings. Specifically Project Settings | Debug |GdScript. There you can disable all or specific warnings and errors, though I wouldn't recommend you do that.

For details, see:

https://docs.godotengine.org/en/3.1/classes/class_projectsettings.html#class-projectsettings-property-debug-gdscript-warnings-enable

Additionally, you can disable specific warning/errors in a given source code file using a number of directives. Rather than going into the details, here's a link to a relevant discussion:

https://www.reddit.com/r/godot/comments/ay176j/can_i_disable_certain_warnings/

by (14,828 points)
edited by

I see, could a lot of them leads to big issues or slowed loading?

–1 vote

If the errors are yellow you shouldn't worry about them.

by (51 points)
+1 vote

You can add an underscore in front of any argument (_body) to make these errors go away. As far as I know they don't hurt, they're just info.

You can also click on Project -> Project Settings -> Debug -> GdScript and disable "Unused Argument" to disable these messages for your entire project.

by (30 points)

Yes, you could also toggle them at the bottom of the script, but i'll keep them and try to remove them in time.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.