Ive made a script to enable all children when a collision is activated, but im not sure how to check if the player is not there so the children can be disabled
Hi @ALUCARD!
What about doing the opposite with onTriggerLeave
?
https://developer.playcanvas.com/en/api/pc.CollisionComponent.html#event:triggerleave
The code doesnt seem to work properly, it does not give any errors but the children remain enabled. Am I doing something wrong?
You need to add the triggerleave
event like you do on line 5 for triggerenter
.
I just noticed that myself
1 Like