mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 20:36:38 +02:00
27 lines
670 B
JavaScript
27 lines
670 B
JavaScript
//
|
|
// hideAvatarExample.js
|
|
// hifi
|
|
//
|
|
// Created by Brad Hefta-Gaub on 1/28/14.
|
|
// Copyright (c) 2014 HighFidelity, Inc. All rights reserved.
|
|
//
|
|
// This is an example script that demonstrates how to enable or disable local rendering of your own avatar
|
|
//
|
|
//
|
|
|
|
function keyReleaseEvent(event) {
|
|
if (event.text == "F2") {
|
|
MyAvatar.shouldRenderLocally = !MyAvatar.shouldRenderLocally;
|
|
}
|
|
}
|
|
|
|
// Map keyPress and mouse move events to our callbacks
|
|
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
|
|
|
|
|
function scriptEnding() {
|
|
// re-enabled the standard behavior
|
|
MyAvatar.shouldRenderLocally = true;
|
|
}
|
|
|
|
Script.scriptEnding.connect(scriptEnding);
|