Hi , I am facing issue with movement which gets stuck at boundary edges sometimes.
In player movement I am checking condition whether he is inside the boundary only if he is in then can be moved. sometimes it gets stuck.
Project link :
PlayCanvas 3D HTML5 Game Engine
can you tell whether the issue is due to boundary condition or collision with bullets which comes from the enemy . Here player mass is 500 & bullets mass is just 1.
thank you
Now issue seems to be fixed because I changed isPlayerInsideTheBoundary() logic
PlayerController.prototype.isPlayerInsideTheBoundary = function (playerPosition, mouseDirection) {
let nextPlayerPosition = playerPosition.clone().add(mouseDirection);
return (
nextPlayerPosition.x > this.leftBoundaryPos.x + this.offsetFromBoundary &&
nextPlayerPosition.x < this.rightBoundaryPos.x - this.offsetFromBoundary &&
nextPlayerPosition.y > this.bottomBoundaryPos.y + this.offsetFromBoundary &&
nextPlayerPosition.y < this.topBoundaryPos.y - this.offsetFromBoundary
);
}