Skip to content

Commit

Permalink
Fix script_rigidbody_trigger sample bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yangol-oleksiy committed Mar 6, 2022
1 parent 17bc551 commit c41aa70
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions script_rigidbody_trigger/Sources/arm/Trigger.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ class Trigger extends iron.Trait {
// TODO: replace with notifyOnCollisionEnter or notifyOnTriggerEnter once implemented
// ref: https://github.com/armory3d/armory/issues/331
var rbs = physics.getContacts(object.getTrait(RigidBody));
var visible = false;

if (rbs != null) {
for (rb in rbs){
if(rb.object.name == "Cube"){
obj.visible = true;
visible = true;
}
}
} else {
obj.visible = false;
}

obj.visible = visible;
});
}
}

0 comments on commit c41aa70

Please sign in to comment.