Which node types I need for a destroyable wall (animated)?

Godot Version

4.3

Question

I want to build a simple 2D sidescoller, where my little son can jump around with a Ankylosaurs.

Part of it is, that I want to build a wall which is destroyable when a specific button is pressed. The breakdown of the wall should be animated. As long as the wall is not destroyed, the player should be blocked by the wall.

I just don’t know what node types I should use for this. So far I worked only with AnimatedSprite2D and CollisionShapes2D. And what I learned is, that Area2D-Node (that I used until now) are more a thing to check if objects are around each other and are not able to block player movement - what I need till the wall is destroyed.

I will read the documentions etc. but maybe you can just give me a hint where to start. Do I need a StaticBody2D and have to learn to use the AnimationPlayer for this? Or is this the wrong way?

Guess I found out. Even if I didn’t all the days before … as soon as I asked for help… nevermind.

Didn’t know why, but I didn’t think of that I can use all the nodes together under one Area2D node.

So what I have know: Area2D as main. Under that:

  • a Sprite2D (for the wall image) with an AnimationPlayer as child (for the wall brakdown)
  • a StaticBody2D with a CollisionShape2D for blocking the player

When I press a button the animation is played and the StaticBody2D is set queue_free so the player can move on.

Thanks for your time to the people who read the thread. But guess it’s solved. :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.