Small bug:
I found that on the Linux version of Panda3d you can still use the attach method instead of attach (for instance, attachCharacter) in the bullet world.
EDIT: Solved, didn’t edit the title so someone may still find about the bug.
The problem was the camera update, I set the camera task and the moving task to priority 1 and now it is all working perfectly.
Question:
I using the following task to move my character:
def calculateMovement(self):
if (self.updateForce == False):
return
force = Vec3(0.0, 0.0, 0.0)
if (self.jumpStarted == True):
if (self.__validateCounterPositions() == True and self.movementStatesSet > 0):
self.__setMovementForce(force)
force = render.getRelativeVector(self.playerNP, force)
self.playerNode.setLinearMovement(force, True)
self.jumpStarted = False
self.playerNode.doJump()
if (self.movementStatesDict[MovingCodes.jumping] == True):
if (self.playerNode.isOnGround() == True):
self.movementStatesDict[MovingCodes.jumping] = False
else:
return
if (self.__validateCounterPositions() == True and self.movementStatesSet > 0):
self.__setMovementForce(force)
force = render.getRelativeVector(self.playerNP, force)
self.playerNode.setLinearMovement(force, True)
self.updateForce = False
This is called in a task and the movement is correct. It works in a wow like way: you move with WASD, you rotate the character with the mouse, and you can jump (but you can’t move mid air).
The problem is that when you move in a direction, such as left, the movement is terribly interpolated and gives the impression that the character is being teleported from one point to another really fast. Is there any way that I can make it smoothier?
Should I try to use intervals instead? I wouldn’t really like it because they won’t give me as much controll as I would like, also, I am pretty sure I read in the manual I can move a node with physics using intervals.
Any help would be greatly appreciated.