repo: janusweb action: commit revision: path_from: revision_from: de9f8eabfb443c545a4383a0932453ab2eb23450: path_to: revision_to:
commit de9f8eabfb443c545a4383a0932453ab2eb23450 Author: James BaicoianuDate: Thu Oct 17 17:17:55 2024 -0700 Added player.attachObject() function diff --git a/scripts/janusplayer.js b/scripts/janusplayer.js
--- a/scripts/janusplayer.js
+++ b/scripts/janusplayer.js
@@ -1346,5 +1346,14 @@ document.body.dispatchEvent(click);
}
}
}
+ this.attachObject = function(attachpoint, obj) {
+ if (this.ghost && this.ghost.body) {
+ if (attachpoint in this.ghost.body.parts) {
+ this.ghost.body.parts[attachpoint].add(obj);
+ }
+ return obj;
+ }
+ return false;
+ }
}, elation.engine.things.player);
});
-----END OF PAGE-----