0 votes

I've been trying to solve this issue for a few days now. I'm working on a farming simulator, and trying to prototype hoeing grass into dirt for planting.

I found this from one of Godot's tutorials: https://docs.godotengine.org/en/latest/getting_started/first_3d_game/05.spawning_mobs.html

But this does something using a specific scene, which would limit me later. (Not sure how to get around it)

I also found this, but the example is incomplete: https://docs.godotengine.org/en/latest/getting_started/first_3d_game/05.spawning_mobs.html

So far I've tried to use a GridMap with set_cell_item. But I can't get the location right, and I can't seem to remove the object currently in place of the swapped object. (I've also heard the GridMap solution doesn't scale very well).

In any case, any help would be greatly appreciated.

Godot version v3.3.3 stable
in Engine by (24 points)

1 Answer

0 votes

With an idea like this GridMap is still best sollution. Too bad in Godot 3.1 it is kind of clunky.
What do You mean You can't get position right ? You propably need to dig into how worldtomap and maptoworld work, it is easy.

Setcellitem should remove former item. If it is not happening, than You must have messed up tile scale. Simply set cell_size to be the very same as size of meshes ( in meters actually, just change it until one mesh fits in one cell ).

Never change scale of whole GridMap node.

Remember, that if You want to place some objects onto another ( like fence on the grass ), than You will need two gridmaps

by (2,416 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 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.