31 lines · 753 B · JavaScript
RawDownload
  var orientation = Camera.getOrientation();  orientation = Quat.safeEulerAngles(orientation);  orientation.x = 0;  orientation = Quat.fromVec3Degrees(orientation);  var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getForward(orientation)));   // Math.random ensures no caching of script  var SCRIPT_URL = Script.resolvePath("myEntityScript.js")   var myEntity = Entities.addEntity({      type: "Sphere",      color: {          red: 200,          green: 10,          blue: 200      },      position: center,      dimensions: {          x: 1,          y: 1,          z: 1      },      script: SCRIPT_URL  })    function cleanup() {      // Entities.deleteEntity(myEntity);  }   Script.scriptEnding.connect(cleanup);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t