Collision Start Event Not Always Registering?

Hello, I am trying to get entities to disable when hitting the entity “ground” in my project, but the collision event is not always registering. This is the very simple script I have used - https://playcanvas.com/editor/code/768979?tabs=43456158

EDITOR - https://playcanvas.com/editor/scene/1100701
LAUNCH = https://launch.playcanvas.com/1100701?debug=true

Click anywhere on the screen to shoot the tower to reproduce the bug. The script is meant to disable the entity when they fall off the platform and onto the ground.

Hi @XKRS-GT,

Change your collision start callback to:

    if (result && result.other.name === "ground") {
        this.entity.enabled = false;
    }
2 Likes

To add to @Leonidas, you can also check the colliders and triggers manual (near the bottom):
https://developer.playcanvas.com/en/tutorials/collision-and-triggers/

2 Likes

Thanks a lot @LeXXik and @Leonidas, this works great.

1 Like