27 lines
601 B
JavaScript
27 lines
601 B
JavaScript
|
|
var scriptURL = Script.resolvePath('testEntity.js?'+Math.random());
|
|
|
|
var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
|
|
x: 0,
|
|
y: 0.5,
|
|
z: 0
|
|
}), Vec3.multiply(1.5, Quat.getFront(Camera.getOrientation())));
|
|
|
|
var test = Entities.addEntity({
|
|
type: "Box",
|
|
position: center,
|
|
dimensions: {
|
|
x: 1,
|
|
y: 1,
|
|
z: 1
|
|
},
|
|
color:{red:255,green:0,blue:255},
|
|
dynamic: false,
|
|
shapeType: 'box',
|
|
script: scriptURL,
|
|
userData: JSON.stringify({
|
|
grabbableKey: {
|
|
invertSolidWhileHeld: true
|
|
}
|
|
})
|
|
});
|