0 votes

Hey all!

I've been hitting a wall for several days now trying to get my player sprite to move along a path made by A*.
I'm quite new to Godot, so I'm sure I'm missing something really simple.

Nevertheless I've so far found almost nothing concerning this sort of implementation, and what I did find was a brief paragraph and code example, which didn't get me far at all.

So, how exactly do you implement movement for a KinematicBody2D in a series of positions along an A*-generated path?

Thanks!

Other info:
If any code is needed, you can find my current non-functional implementation of movement, as well as the stripped down A* implementation I modified from a demo project, at this link: https://hastebin.com/ohixafaboh.cs
I also feel that I should mention my intention for this is to have a click to move system that avoids any static body colliders along its path.
A* seems like the best long-term solution, as I can use the same codebase for NPCs as well, but I am certainly open to other solutions.

in Engine by (12 points)

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.