content/hifi-content/elisalj/2016/random_scripts/pink-rotation.js
2022-02-13 23:16:46 +01:00

28 lines
1.2 KiB
JavaScript

(function () {
var entitySmall = "33394cce-cd91-4e40-b423-119bbf9dcb4b"
function change(entityID) {
print("omg we made it")
Entities.editEntity(entityID, { angularDamping: 0});
Entities.editEntity(entityID, { angularVelocity: { x: 0, y: 25, z: 0} });
Entities.editEntity(entityID, { color: { red: 255, green: 100, blue: 220} });
}
this.enterEntity = function(entityID) {
print("here");
change(entitySmall);
};
this.resetVel = function (entityID) {
Entities.editEntity(entityID, { angularVelocity: { x: 0, y: 25, z: 0 } });
};
this.leaveEntity = function (entityID) {
print("leaveEntity("+entityID.id+")");
Entities.editEntity(entitySmall, { angularDamping: 0.5});
Entities.editEntity(entitySmall, { color: { red: 255, green: 0, blue: 0 } });
setTimeout(resetVel(entitySmall, 5000));
Entities.editEntity(entitySmall, { angularVelocity: { x: 0, y: 25, z: 0 } });
Entities.editEntity(entitySmall, { position: { x: -1, y: 7, z: -85 } });
};
this.preload = function (entityID) {
print("mama we made it");
};
})