Collision Detection issue

I am working on changing one scene to another (i.e. making the game character move from the road into a church). Both the scenes make use of collision detection. I have used two different collision traversers namely: roadTrav and churchTrav, for the two scenes respectively. Unfortunately as I unload the road scene and load the church scene, the roadTrav still applies to the church scene and the churchTrav seems to be having no effect at all :frowning:

During the unloading of the first scene, I have used :

The collision sphere which is used for initializing the scene change from road to church after detecting the character appears in the chuch scene too even though I have used
“self.churchDoorNP.hide()” and “self.churchDoorNP.removeNode()”. The collision lines are visible but as soon as the “self.roadTrav.showCollisions(render)” statement from the road scene is disabled, these disappear. Meanwhile, “self.churchTrav.showCollisions(render)” has no effect in the church scene.
The character and the camera do not move smoothly at all in the new scene.

Please provide your guidance on this issue.


Maybe you forgot to switch the tasks responsible for calling .traverse() ?

Thanks for the reply, ynjh_jo. No, I am prettysure that I am using the correct .traverse() where ever required. Meanwhile, the church scene collision traverser,churchTrav, is working but the roadTraverser too is working and I am not able to disable it :frowning:


you call traversal on it… if you cant stop calling traversal on it the problem is in your code, it does not “auto” traverse unless you are using base.cTrav.

Hello treeform,
I am sorry but I did not understand ur suggestion. Could you kindly put more light on it? Sorry for the trouble.


Panda does collision traversal every frame by default, but only for base.cTrav. This default traversal is done by a default task, named collisionLoop. This task continually executed every frame. It simply calls base.cTrav.traverse().
It seems that you assigned 1 of your traverser to base.cTrav, and also have your own task calling traverse() for the other one.