Collision Detect Problem

I recently started testing out all the collision detect things and I came across a problem. Whenever I search for the collision wall its fine but when I make it visible I get a weird error saying:

    Self.walls.node<>.setIntoCollideMask<BitMask32.bit<0>>
AssertionError: !is_empty<> at line 269 of c:\p\panda3d-1.5.4\panda\src\pgraph\nodePath.I
press any key to continue ...

My main code is: (When you unquote the things in the middle it stops working)

import direct.directbase.DirectStart 
from direct.gui.OnscreenText import OnscreenText  
from direct.showbase.DirectObject import DirectObject 
from pandac.PandaModules import CollisionTraverser,CollisionNode 
from pandac.PandaModules import CollisionHandlerQueue,CollisionRay  
from pandac.PandaModules import AmbientLight,DirectionalLight  
from pandac.PandaModules import Vec3,Vec4,BitMask32 



import sys 


class world(DirectObject):
	
	def __init__(self):
		
		self.title = OnscreenText(text="CarTest    (esc to exit)",
			style=1, fg=(1,1,1,1),
			pos=(0.87,-0.95), scale = .07)
		
		self.accept("escape", sys.exit)
		base.disableMouse()
		
		base.camera.setPosHpr(0, -92.02, 66.49, 0, 324.16, 0)
		
		self.loadModels()
		
		dlight = DirectionalLight('my dlight')
		mainLight = render.attachNewNode(dlight)
		render.setLight(mainLight)
		mainLight.lookAt(self.map)
		
		self.walls = self.map.find("**/mapWall")
		self.walls.node().setIntoCollideMask(BitMask32.bit(0))
		self.walls.show()
				
	def loadModels(self):
		
		self.map = loader.loadModel("models/map")
		self.map.reparentTo(render)
		self.map.setPosHpr(0, 0, 0, 0, 0, 0)
	

w = world()
run()

and, I know this is getting pretty long, my model code, only the part with the collision, is:

<Group> map {
  <Collide> mapWall { Polyset keep descend }
  <Transform> {
    <Matrix4> {
      -41.655731 0.000000 0.000000 0.000000
      0.000000 -41.655731 0.000000 0.000000
      0.000000 0.000000 -41.655731 0.000000
      0.000000 0.000000 0.000000 1.000000
    }
  }
  <VertexPool> map {
    <Vertex> 0 {
      41.655762 41.655731 0.000000
    }
    <Vertex> 1 {
      40.814232 41.655731 0.000000
    }
    <Vertex> 2 {

Thank you for taking the time to look at this. :wink:
Everyone here is always helpful

P.S. Thanks for the help because Im new and only 13. :wink:

The error you’re getting means self.walls is empty – thus, it failed to find it in the find() call.

The problem is: You’re trying to find() a Collide item, while you can only use find() on s or s or s or similar things, since items are not translated into a PandaNode.

So, try having finding for “map” instead of “mapWall”.

So you want me to change:

self.walls = self.map.find("**/mapWall")

to

self.walls = self.map.find("**/map")

?

Depending on what you want. If that is indeed what represents the walls, yes.

Im trying to make it like the example ball-maze where it has the invisible walls on the sides of the map. On th example it said thats what you use to find the collision walls or something.

Yeah. If you made the walls and floors separate meshes in your modeler, you will find them as different entries. When finding the walls, you should specify the name of the that corresponds to the walls.

Ok but I didnt make them seperate but will the collision thing still work

Will what collision thing still work? It should, if you add the Collide tag in the right , the one you want to collide. Dunno how the ball in maze does it.