repo: janusweb action: commit revision: path_from: revision_from: 3bfa92af095732996c5b88ea039e7ea695544cd8: path_to: revision_to:
commit 3bfa92af095732996c5b88ea039e7ea695544cd8 Author: James BaicoianuDate: Sun Jul 5 09:29:29 2020 -0700 Fix for double player collider problem diff --git a/scripts/room.js b/scripts/room.js
--- a/scripts/room.js
+++ b/scripts/room.js
@@ -211,7 +211,10 @@ elation.require([
orientation = spawnpoint.orientation;
}
var player = this.engine.client.player;
- this.appendChild(player);
+ if (player.parent !== this) {
+ // Reparent player to the room if necessary
+ this.appendChild(player.getProxyObject());
+ }
player.position.copy(pos);
player.orientation.copy(orientation);
//player.reset_position();
@@ -1202,6 +1205,8 @@ elation.require([
if (proxyobj) {
if (proxyobj.parent && typeof proxyobj.parent.removeChild == 'function') {
proxyobj.parent.removeChild(proxyobj);
+ } else if (proxyobj._target.parent && typeof proxyobj._target.parent.remove == 'function') {
+ proxyobj._target.parent.remove(proxyobj._target);
}
//var realobj = this.room.getObjectFromProxy(proxyobj);
var realobj = proxyobj._target;
-----END OF PAGE-----