0 votes

Hi, I have a problem, I have a tree in my game and if the player enters the tree on the left or right then he can cut it down. as soon as it is felled, 3 wood items should be dropped.How do you do that? Does anyone know what I mean and how to do it?Thanks in advance

Godot version 3.2.3
in Engine by (86 points)

1 Answer

0 votes

First you need something to identify the start of the cut, in a 2D game using tilemap, an InputEvent function on the TileMap, reading information like the tool used, the distance between the player and the tree and of course if that tile is a tree, would be enough to start a cutting animation. When the cut is finished, you will need to change the tree tile to something like a trunk and call a function that will generate these woods on the floor. I've seen something similar on this site, it's simple but it opened my mind to the idea.

https://github.com/oiblank/godot-farming-prototype

by (215 points)
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.