0 votes

i'm still pretty new to Godot, and i can't figure out how to do this, If you need a reference, look up some gameplay of the Wii game Dokapon Kingdom, it's basically the system i'm trying to create,
thanks in
advance!

Godot version 3.3.1
in Engine by (12 points)
edited by

Hmm... I found a lot of resources (though most of them are 2d) on similar topics.
Here are some I found:
https://kidscancode.org/godot_recipes/2d/grid_movement/
Along with some similar questions as well.
https://godotengine.org/qa/71825/grid-based-movement-limit-display-potential-move-distance?show=71825#q71825
https://godotengine.org/qa/99354/grid-based-movement?show=99354#q99354
https://godotengine.org/qa/65646/how-do-i-add-grid-based-movement-to-a-isometric-tilemap?show=65646#q65646
https://godotengine.org/qa/70995/pls-help-grid-movement-demo-movement-interpolation?show=70995#q70995

How I would go about doing it would be to create a dictionary. Please do not, however, that I know near-to-nothing about 3D, so I apologize if these techniques do not transfer properly.

Here's a tutorial on dictionaries, in case you don't know: https://docs.godotengine.org/en/stable/classes/class_dictionary.html
If you need more help on dictionaries, search up python dictionaries, they're literally the same thing in gdscript.

So what I would do is this: (remember to add proper indents!)

var grid = {
a1 = position3d(1, 1, 1)
a2 = position3d(2, 2, 2)
}

please note that position3d is probably not a real function

And so on.
If you're looking for a more of an infinite grid-based system, you could just move everytime by a set amount.

translateright(40)
translate
left(40)
translateup(40)
translate
down(40)

disclaimer: functions above are probably not real functions. Just used as placeholders :D

Other than that, I have no idea how to do this. Please do note that this is just a suggestion for you to use, and I am terribly sorry if my suggestions do not work. Hope your problem works out :).

Please log in or register to answer this question.

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.