I tried
Code: Select all
for i = 1,#self.walls do
self.HC:remove(self.walls[i])
end
I also triedHC/init.lua:75: attempt to call method 'bbox' (a nil value)
Code: Select all
for i = 1,#self.walls do
local hash = scene.HC:hash()
hash:remove(self.walls[i], self.walls[i]:bbox())
end
More info in code tags because I don't know how to do inline code:HC/init.lua:49: attempt to index local 'self' (a nil value)
Code: Select all
"self.walls[i]" definitely exists because "self.player:moveTo(self.walls[i]._polygon.centroid.x,self.walls[i]._polygon.centroid.y)" works (inside the loop) so that's probably not the problem, and "self.walls[i]:bbox()" works too.