Chopping/breaking trees system

Godot Version

4.1.3 stable_mono


Hello, I’m trying to make 2d top down survival game and I can’t figure out how to make breaking system like chopping trees, etc.
I don’t know if I should use tilemap or sprite 2d node for it. I have my tree node as unique scene and it have Rigidbody2d node with tree sprite on it and area 2D node to understand when a player is near a tree and performs an action. I wanted to make tree break when player hit it, using area2D.

Is there any way to make a certain tree break or should I use a tilemap for this?

There is some code I tried to make

You shouldn’t use a TileMap for this. TileMaps are better for static stuff and not animated stuff like chopping a tree down. Just put an area2d on the tree and on the player and have the player detect if it’s near a tree when the chopping button is pressed.

I think I get it, thanks you!

If someone will have same question I ended up with code like this

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