what is wrong with this argument

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

all i did was follow the 2d tutorial from the GODOT website and it does not specify how to or if this is eve3n needed it only gives me errors the walkthrough needs a thorough going over or ill just use unity lol also it tells you to hide the player which makes it never show wtf on top of that following tutorial whole way does not work can someone please try this on a steamdeck and see if this just me being a noob

func _on_Player_body_entered(body):
hide() # Player disappears after being hit.
emit_signal(“hit”)
# Must be deferred as we can’t change physics properties on a physics callback.
$CollisionShape2D.set_deferred(“disabled”, true)

returns this dumb error

The argument ‘body’ is never used in the function ‘_on_Player_body_entered’

the walkthrough is making me feel like no one cared about new people when they made it, it severely lacks information and skips over tons of steps how do you expect new people to adopt your platform when this is the case

:bust_in_silhouette: Reply From: Gluon

If you arent going to use the body argument in your code try doing this

func on_Player_body_entered(_body):
    your code here

by putting an underscore ahead of body it should remove the error.

I actually found the tutorials on the godot engine documentation very helpful personally but it cannot teach you everything at once or it will be too much. Its unfortunate that you have had difficulties.

good point, but what does that have to do with the whole I FOLLOWED THE TUTORIAL part. getting annoying yellow warnings from following a tutorial is a hard pass for me FIX THE TUTORIAL

BarkingSpid3r | 2023-01-19 15:21

Yellow warnings are fairly common and dont affect the game running. The red warnings are actually broken code, yellow only indicates something which you may want to look at and check.

Gluon | 2023-01-19 15:41

Honestly I don’t think it is explained at all, kinda dumb for something teaching people, at least explain that it will give an error and that its ok zero explanation during tutorial

BarkingSpid3r | 2023-01-19 15:56