mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
equipping
This commit is contained in:
parent
47c2119888
commit
aed5629eca
3 changed files with 7 additions and 2 deletions
|
@ -773,7 +773,7 @@ function MyController(hand) {
|
|||
this.setState(STATE_CONTINUE_NEAR_GRABBING);
|
||||
} else {
|
||||
// equipping
|
||||
Entities.callEntityMethod(this.grabbedEntity, "startEquip");
|
||||
Entities.callEntityMethod(this.grabbedEntity, "equip", [JSON.stringify(this.hand)]);
|
||||
this.setState(STATE_CONTINUE_EQUIP_BD);
|
||||
}
|
||||
|
||||
|
@ -808,6 +808,7 @@ function MyController(hand) {
|
|||
}
|
||||
if (this.state == STATE_CONTINUE_NEAR_GRABBING && this.bumperSqueezed()) {
|
||||
this.setState(STATE_CONTINUE_EQUIP_BD);
|
||||
Entities.callEntityMethod(this.grabbedEntity, "equip", [JSON.stringify(this.hand)]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
equip: function() {
|
||||
this.equipped = true;
|
||||
print("EQUIP")
|
||||
|
||||
},
|
||||
unequip: function() {
|
||||
this.equipped = true;
|
||||
|
@ -36,5 +38,6 @@
|
|||
};
|
||||
|
||||
// entity scripts always need to return a newly constructed object of our type
|
||||
print("TOOOss")
|
||||
return new Pistol();
|
||||
});
|
|
@ -1,6 +1,7 @@
|
|||
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(Camera.getOrientation())));
|
||||
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(1.5, Quat.getFront(Camera.getOrientation())));
|
||||
var scriptURL = Script.resolvePath('pistol.js');
|
||||
var modelURL = "https://s3.amazonaws.com/hifi-public/eric/models/gun.fbx";
|
||||
print("SJDJDJ")
|
||||
|
||||
var pistol = Entities.addEntity({
|
||||
type: 'Model',
|
||||
|
|
Loading…
Reference in a new issue