Hi guys,
In this function:
b2.PolygonShape:set(vertices) |
vertices: A list of numbers that contains the x, y coordinates of the vertices sequentially
Now I want to build a polygon dynamically, that mean I must pass it coordinates to this function but I don't know how to build and pass a list of numbers.
I tried with a string:
b2.PolygonShape:set('1,2,3,4,5,6') |
or an array:
b2.PolygonShape:set({1,2,3,4,5,6}) |
but got these errors:
bad argument #1 to 'set' (number expected, got string)
bad argument #1 to 'set' (number expected, got table)
Comments
it should be like this:
Likes: hgvyas123, thanhquan1512