- Home /
Waypoints and AI pathfinding
I would like to know how to get a character to find its current position and then find the position of a gameobject (waypoint1) and move towards it. I have made a walk function and a moveSpeed and turnSpeed variables. Can someone help? PS is it possible for all of the scripting to be javascript as I don't understand C#.
What's in your walk function so far? Can you post the script?
Answer by jashan · Jan 15, 2011 at 10:58 AM
This may be more (or less) than what you really need - but this site provides some pretty in-depth information on A*-pathfinding and also a project that will handle pathfinding for you: A* Pathfinding.
There is also an older approach linked from the Unifycommunity Wiki: Pathfinding.
Related question: Pathfinding tools in Unity?
Simply moving towards an object could be achieved with Transform.LookAt(target:Transform). Once you look at the target object, you can simply move forward.
Your answer
Follow this Question
Related Questions
Why isn't a Ai Waypoint Spawning??? 0 Answers
Problems with my waypoints code 1 Answer
What is the best AI system for pathfinding on a moving platform 2 Answers
Waypoint tree structure 2 Answers
Follow up to AI Pathfinding Question 0 Answers