mirror of
https://github.com/overte-org/overte.git
synced 2025-08-03 23:03:20 +02:00
avoid calling editEntity on overlays
This commit is contained in:
parent
0406cc41e0
commit
70efe4aa4f
1 changed files with 8 additions and 2 deletions
|
@ -3878,6 +3878,7 @@ function MyController(hand) {
|
|||
// we appear to be holding something and this script isn't in a state that would be holding something.
|
||||
// unhook it. if we previously took note of this entity's parent, put it back where it was. This
|
||||
// works around some problems that happen when more than one hand or avatar is passing something around.
|
||||
var childType = Entities.getNestableType(childID);
|
||||
if (_this.previousParentID[childID]) {
|
||||
var previousParentID = _this.previousParentID[childID];
|
||||
var previousParentJointIndex = _this.previousParentJointIndex[childID];
|
||||
|
@ -3895,7 +3896,7 @@ function MyController(hand) {
|
|||
}
|
||||
_this.previouslyUnhooked[childID] = now;
|
||||
|
||||
if (Overlays.getProperty(childID, "grabbable")) {
|
||||
if (childType == "overlay" && Overlays.getProperty(childID, "grabbable")) {
|
||||
// only auto-unhook overlays that were flagged as grabbable. this avoids unhooking overlays
|
||||
// used in tutorial.
|
||||
Overlays.editOverlay(childID, {
|
||||
|
@ -3903,7 +3904,12 @@ function MyController(hand) {
|
|||
parentJointIndex: previousParentJointIndex
|
||||
});
|
||||
}
|
||||
Entities.editEntity(childID, { parentID: previousParentID, parentJointIndex: previousParentJointIndex });
|
||||
if (childType == "entity") {
|
||||
Entities.editEntity(childID, {
|
||||
parentID: previousParentID,
|
||||
parentJointIndex: previousParentJointIndex
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
Entities.editEntity(childID, { parentID: NULL_UUID });
|
||||
|
|
Loading…
Reference in a new issue