I didn’t want to make a fresh post on this.
I got it working, thanks to your post Cyan.
My model now walks across the terrain during the interval.
However, I have one problem, because of the way my game is setup.
When the user exits the game, it is supposed to cleanup everything and
return to the main menu. So that when the user presses play, he enters
the game “with a clean slate”.
My problem is that everything has been cleaned up, except the collision
thing (the red thing that is seen when you uncomment
self.cTrav.showCollisions(render)). The used one is left behind, and a
new one create each time the game starts.
I am not sure, but I believe it has something to do with
self.playerZcol.traverse(render) in this code:
# Update Player Z (Keep player on Terrain)
def updatePlayerZ(self, time):
if self.page == 1:
startpos = self.Mod1.getPos()
self.playerZcol.traverse(render)
if self.playerZcolQueue.getNumEntries>0:
self.playerZcolQueue.sortEntries()
point = self.playerZcolQueue.getEntry
(0).getSurfacePoint(self.env)
self.Mod1.setZ(point.getZ())
else:
self.Mod1.setPos(startpos)
# End updatePlayerZ
Is there a code I can use to clean this up when I end the game?
Also, is there a code in Panda, that calls “restart game”?
Thanks