Skip to content

Commit

Permalink
Merge pull request #47 from yangol-oleksiy/script-rigidbody-fix
Browse files Browse the repository at this point in the history
Fix script_rigidbody_trigger sample bug
  • Loading branch information
luboslenco committed Mar 7, 2022
2 parents 17bc551 + c41aa70 commit 32a8d77
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 32a8d77

Please sign in to comment.