Hello. I’m making custom pathfinding. For now, I’m stuck with path, which declared in nD array (explanation of nD: if path have 5 ceils, it will be 5D: Path[Vector1][Vector2][Vector3][Vector4][Vector5]). And with this nD array I got big problem: How I can write that all, to write another 1 VectorN to the end?
local Path = Pathes -- "Pathes" is start of that giant nD array
for i = 1, #CurrentPath, 1 do -- "CurrentPath" is array which stores all Points in the current Path.
Path = Path[CurrentPath[i]]
end
but this won’t give me actual end of array, just “copy” of it.
Can someone help me with my problem, please?
local Path = Pathes -- "Pathes" is start of that giant nD array
for i = 1, #CurrentPath, 1 do -- "CurrentPath" is array which stores all Points in the current Path.
Path = Path[i]
end
local Path = Pathes -- "Pathes" is start of that giant nD array
for i = 1, #CurrentPath, 1 do -- "CurrentPath" is array which stores all Points in the current Path.
Path = CurrentPath[i]
end
And if I just index “Path” with 1 waypoint, I won’t be able to add new waypoint to the end, for example to Pathes[Vector3.new(0,0,0)][Vector3.new(0,0,1)][Vector3.new(0,0,2)][Vector3.new(0,0,3)]