From 51d58744c9caddc742f0203f0eca76c5f36fa80b Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Fri, 10 Oct 2003 20:13:30 +0000 Subject: [PATCH] better handling of toon falling out of world --- direct/src/showbase/PhysicsWalker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/direct/src/showbase/PhysicsWalker.py b/direct/src/showbase/PhysicsWalker.py index 07129068bf..0042711872 100755 --- a/direct/src/showbase/PhysicsWalker.py +++ b/direct/src/showbase/PhysicsWalker.py @@ -230,7 +230,9 @@ class PhysicsWalker(DirectObject.DirectObject): # hack fix for falling through the floor: if contact==Vec3.zero() and self.avatarNodePath.getZ()<-50.0: # reset: - self.avatarNodePath.setPos(Vec3(0.0, 0.0, 20.0)) + # DCR: don't reset X and Y; allow player to move + self.avatarNodePath.setZ(50.0) + self.resetPhys() # Determine what the speeds are based on the buttons: self.__speed=(self.__forwardButton and self.avatarControlForwardSpeed or