Hi again folks
I have been struggling with these collisions, and I think I must be missing something fundamental.
When I try to implement the method that Hypnos suggested, my character alyways sticks in the same spot. I think this is because of the last line in this bit of code (from roaming ralph), since the collisionPusher wont match those criteria.
entries = 
for i in range(self.ralphGroundHandler.getNumEntries()):
entry = self.ralphGroundHandler.getEntry(i)
entries.sort(lambda x,y: cmp(y.getSurfacePoint(render).getZ(),
if (len(entries)>0) and (entries.getIntoNode().getName() == "terrain"):
If I remove that line though, or try and make it only match to collisions with the ray, it seems to stop working, and I can just float wherever I like in my level.
I have been reading the manual, and trying to implement the CollisionHandlerFloor and CollisionHandlerPusher, cos they look like the answer to my problems.
I scrapped all the old collisions from Roaming Ralph, and instead I have a traverser defined as follows
traverser = CollisionTraverser('mainTraverser')
base.cTrav = traverser
and then in the world class, I have the following (And there is an actor defined too, called mitch)
#In theory this will handle wall collisions
self.wallObject = self.mitch.attachNewNode(CollisionNode('wallNode'))
self.wallObject.node().addSolid(CollisionSphere(0, 0, 1, 2))
self.pusher = CollisionHandlerPusher()
#and this should handle floor collisions
self.floorObject = self.mitch.attachNewNode(CollisionNode('floorNode'))
self.floorObject.node().addSolid(CollisionRay(0, 0, 0, 0, 0, -1))
self.lifter = CollisionHandlerFloor()
I guess, part of the problem is that the terrain is now not mentioned anywhere, so how would the CollisionHandlerPusher and CollisionHandlerFloor know about it. It needs to be somehow defined as an “into” object, am I right?