any other way to set up collision for a 'town'?

is there any other way to set up a collision detection wall other than placing the collision planes/polygon one by one? :question: :confused:

i still new at this tho i’m tasked to do scripting. lol
:cry:

You could just leave your town as geometry, and make sure the other objects that collide with them are collisionsolids.
To make the town geometry collideable, try this:

townNodePath.setCollideMask(BitMask32(1))
#replace 1 with the bit you like

in case of you made it work:-> if it’s an entire town you most likely run into performance issues in the end.
once you have it working you might want to check out the “octree” code for collision. it’s posted somewhere on the forum. maybe showcase or so. this might help you over performance issues once you encounter them.
good luck :slight_smile:
if you need further help feel free to ask.

thx for all ur help!
but i dun understand the octree script. can anyone put it down to easier terms? :blush:

well it’s not neccessary to understand octrees as such.
but as simple example. lets say you have a city with 30000 polys in it.
if you have it in one node the collision algorythm would do 30000 collision checks against your colission object (e.g. sphere)
if you put it in octrees the scene will be split into cubes. each one contains 8 more cubes and so on.

using this system you can skip tons of tests cause you most polygons are somewhere totaly else.
so with octree you do about 8+8+8+8 checks until you reached the box you’r in. then in your block there might be about 7 or 8 triangles… makes roughly 40 collision checks instead of 30000.
thats only an example but it works very simmilar to it. depending on your scene the speed of collision checks can increase a lot.

if you wanna know how to use it… hm… well i never tried it myself :stuck_out_tongue: in this case you better ask in the octree-script-thread