Node configuration warning for 2d character body not going away

Godot Version

` 4.5.1.stable

I’m extremely new to game development so I’m following a YouTube tutorial and I need to add a collision shape to the sprite and I’ve done that but it’s still giving me an error saying I need a collision shape what else do I need to do to get rid of it

Hi,

You need to follow 3 steps to add a collision to your sprite:


1/ Add a node for the type of collision you want. Can be a StaticBody for hard collisions, an Area for triggers, etc. I guess your tutorials uses a specific one, I’ll go for an Area as an example:
image


2/ The area cannot work by itself as it doesn’t have a shape, and without a shape, Godot has no way to detect collisions. So, you need to add a CollisionShape as a child node:


3/ The shape node has a shape property (in the Inspector tab) that you need to define. You can go for any shape you want, it all depends on the use case.
Once the shape is set, the warning should disappear.