content/hifi-content/jazmin/dev/scripts/drinkDetachEntity.js
2022-02-13 23:57:50 +01:00

20 lines
734 B
JavaScript

// Script written by Thoys, mainly for fun , feel free to use it for anything
(function() {
function unsetAttachments() {
var currentAttachments = MyAvatar.getAttachmentsVariant();
var newAttachments = [];
currentAttachments.forEach(function(attachment) {
if (attachment.jointName !== 'LeftHand' && attachment.jointName !== 'RightHand') {
newAttachments.push(attachment);
}
});
MyAvatar.setAttachmentsVariant(newAttachments);
}
this.startNearTrigger = function(entityID, args) {
unsetAttachments();
};
this.clickReleaseOnEntity = function(entityID, mouseEvent) {
unsetAttachments();
};
})