content/hifi-public/scripts/moving-platform.js
Dale Glass 0d14e5a379 Initial data.
Needs a lot of cleanup. Data has been de-duplicated, and where identical copies existed, one of them
has been replaced with a symlink.

Some files have been excluded, such as binaries, installers and debug dumps. Some of that may still
be present.
2022-02-13 18:59:11 +01:00

40 lines
892 B
JavaScript

var platform;
function init() {
platform = Entities.addEntity({
name: "platform",
type: "Box",
position: { x: 0, y: 0, z: 0 },
dimensions: { x: 10, y: 2, z: 10 },
color: { red: 0, green: 0, blue: 255 },
gravity: { x: 0, y: 0, z: 0 },
visible: true,
locked: false,
lifetime: 6000,
velocity: { x: 1.0, y: 0, z: 0 },
damping: 0,
isDynamic: false
});
if (platform) {
if (MyAvatar.getParentID() != platform) {
MyAvatar.position = { x: 0, y: 3, z: 0 };
MyAvatar.setParentID(platform);
}
}
}
function update(dt) {
}
function shutdown() {
if (platform) {
MyAvatar.setParentID(0);
Entities.deleteEntity(platform);
}
}
Script.setTimeout(init, 3000);
Script.update.connect(update);
Script.scriptEnding.connect(shutdown);