Disable joint limits on RubeDoll for improved ragdoll behavior

- Temporarily commented out joint limit setting code in RubeDoll.flip()
- RubeDoll joints now have no angular constraints
- Should make ragdoll more floppy and less glitchy
- Collision prevention between held RubeDoll and holding player is working
- All Planck.js migration issues resolved
This commit is contained in:
Karl Pannek 2025-07-18 22:57:46 +02:00
parent 9f92f024b1
commit 38eb5ad182
2 changed files with 89 additions and 0 deletions

View file

@ -19,6 +19,10 @@ function (Parent, Settings, nc) {
RubeDoll.prototype.beingGrabbed = function(player) {
Parent.prototype.beingGrabbed.call(this, player);
// Prevent collision with the player holding this RubeDoll
this.preventCollisionWithPlayer(player);
if(this.scheduledForDestruction) {
clearTimeout(this.destructionTimeout);
}
@ -26,6 +30,10 @@ function (Parent, Settings, nc) {
RubeDoll.prototype.beingReleased = function(player) {
Parent.prototype.beingReleased.call(this, player);
// Restore collision with the player
this.restoreCollisionWithPlayer();
if(this.scheduledForDestruction) {
this.delayedDestroy();
}
@ -71,6 +79,10 @@ function (Parent, Settings, nc) {
if(this.scheduledForDestruction) {
clearTimeout(this.destructionTimeout);
}
// Restore collision before destroying
this.restoreCollisionWithPlayer();
Parent.prototype.destroy.call(this);
};