Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
So, recently I was working on some sort of pathfinding. Turns out, after (mostly) a single day of having no life, I was able to do this! Sure, it uses the scene nodes as a path points (I have no idea how to call these), but hell, I think it is insane that I've managed to do this. Now I have to do everything else for my AI, since I only made a pathfinding. But here's the problem: to generate a path, behavior uses a single function. It looks kinda like that: PathFind (Pos, PlrPos, this.Folder); // this part lies in a prototype.onAnimate function, calling the function named as "PathFind" function PathFind (Pos, PlrPos, Folder) // this one is a standart function And the problem is that I don't know how do I take the resulting array (which contains the coordinates of points) from this function to the behavior. Things like "this.Path" didn't really worked. How do I get access to it then? |
||||
|
Your function probably returns path.. so you can acces it maybe something like this.. mypath=pathfinder(param1,param2,param3); (function return value will be mypath variable now) if you call it like this: PathFind (Pos, PlrPos, this.Folder); then you dont store return value anywhere. if you call it so: mypath=PathFind (Pos, PlrPos, this.Folder); then its stored in mypath variable. But it all depends what and how is your function build-- there is many ways how to do it. |
||||
|
Oh, that actually works, sven! Thank you very much for help. |
||||
|
Dekon_17, Coppercube doesn't have pathfinding node. Dekon_17, you are a genius to do pathfinding in Coppercube. |
|