0 votes

enter image description here

Hi, my name is Jeremias and i have a question:
How can I do that if you select any character and then select a tree, that the character runs to the tree and then the tree falls?

(on the left you can see what i mean.)

in Engine by (86 points)

1 Answer

+1 vote
Best answer

The easiest approach to this would be to use a Navigation2D as a parent on your TileMap node, and in your TileMap node, for the TileSet you're working with for the grass/ground, make sure the Navigation shapes are set for all your tiles. It's very easy then to implement navigation from one point to another with Navigation2D. Here's a plugin I've made which would largely do it for you, but you're welcome just to study the code to understand how it works as well:

https://github.com/WolfgangSenff/Godot-Navigator2D

Here's a tutorial for generally using Navigation2D with TileMaps in Godot - it should get you most of the way there for this question:

https://www.youtube.com/watch?v=KU1PslMiZ98&list=PLsk-HSGFjnaEVtp4pR-N0RGt-iNmvSH5h&index=3&ab_channel=KidsCanCode (Notice the version used here is very old, but should apply mostly to the current version I think.)

by (110 points)
selected by

Hi, thank you for your answer, whats the name of the plugin? I downloaded it form Github but how can i drag it in the godot game engine? Or can i download it in Godot?

And i have a another question, how can I make that I can interact with the tree as a player, but also that it is an object where you can pass it, i.e. a non-navigable object?

More questions
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 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 webmaster@godotengine.org with your username.