Hey everyone. As you may or may not have notice my game seems to have a werid collision issue with smaller walls. I’m not sure how to go about fixing it as with most examples look for a wall or a floor, and cotrees just give leaves back. Anyone know how to maybe go about fixing it?
The collision was made using the octree code.
#Setup the collision manager.
base.cTrav = CollisionTraverser()
base.cTrav.setRespectPrevTransform(True)
#Pusher.
base.pusher = PhysicsCollisionHandler()
#Collision queue, this is for collision even.
base.handlerQueue = CollisionHandlerQueue()
#Setup the collision event handler.
base.handler = CollisionHandlerEvent()
base.handler.addInPattern('into-%in')
base.handler.addOutPattern('outof-%in')
#Enable built in physics.
base.enableParticles()
#Set up the gravity force.
self.gravityFN=ForceNode('world-forces')
self.gravityFNP=render.attachNewNode(self.gravityFN)
self.gravityForce=LinearVectorForce(0,0,-9.81)
self.gravityFN.addForce(self.gravityForce)
#Attach it to the global physics manager.
base.physicsMgr.addLinearForce(self.gravityForce)
#Add a actor node to the scene and then attach our collision sphere to our actor nod.
self.anp = render.attachNewNode(ActorNode("actor"))
self.cnodePath = self.anp.attachNewNode(CollisionNode('CollisionSphere'))
#SetUp the collision sphere.
self.csphere = CollisionSphere(0, 0, 0, 4)
self.cnodePath.node().addSolid(self.csphere)
self.cnodePath.node().setFromCollideMask(BitMask32.bit(1))
self.cnodePath.node().setIntoCollideMask(BitMask32.allOff())
#Add the actor node and or collision node to the pusher and to the collision manager.
base.pusher.addCollider(self.cnodePath,self.anp,base.drive.node())
base.cTrav.addCollider(self.cnodePath,base.pusher)
#Attach it to the global physics manager.
base.physicsMgr.attachPhysicalNode(self.anp.node())