|
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?
(comments are locked)
|
|
really? did i do a bad job explaining or something? 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)
|

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