x


grid pathing system

hey guys! i got a bit of a weird one. i have created a grid and i managed to create a code that allows the user to choose a start and an end inside the grid. i made a simple vehicle that normally is only able to follow a specified target. what i need now is for that vehicle to find its target ( the start and end). then it needs to follow that path then turn around and stop right back where it started at start.

originally my idea was to just switch the game object target with the code for starting and end when i realized i didn't know how to do that...the code is way too long to throw in unity answers.

am i on the right track or is their a better way?

more ▼

asked Mar 09 '11 at 04:14 AM

clay gravatar image

clay
2 3 4 4

Perhaps you could tell us which pathfinding library you are using, that would make things a lot easier.

Mar 10 '11 at 05:33 PM TowerOfBricks
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

really? did i do a bad job explaining or something?

more ▼

answered Mar 13 '11 at 08:29 PM

clay gravatar image

clay
2 3 4 4

I'd say it's a bit unclear. Start and end, is it a straight line or is it a path? Do you use pathfinding? Is that what you mean by "follow a specified target"? What is "target", is it a point in the grid or some object that is located on the grid? And please answer comment replies instead of writing an answer. There is a small "add comment" link just below your question.

Mar 13 '11 at 08:41 PM Statement ♦♦

did see it. isnt a straight line nothing more then a path to begin with? yes, it uses path finding. target used to be a gameobject. now itneeds to be what i guess we can all a node on the grid... you choose the node inside unity instead of inside the code.but the targetting needs to happen in the code instead of inside unity

Mar 16 '11 at 07:45 PM clay

didnt see it* phone auto corrected aug

Mar 16 '11 at 07:47 PM clay

i guess its breath first path finding.. which is done. i just need something to make the vehicle find the path to the target.

Mar 16 '11 at 07:48 PM clay
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5056
x265
x251
x237
x25

asked: Mar 09 '11 at 04:14 AM

Seen: 1190 times

Last Updated: Mar 09 '11 at 04:14 AM