Has raycast a bug when a collider gets disabled?

Good day,

I seam to have some wired behavior with ray casts when I disable an entity with an trigger collision object.

What happens?
I suddenly can’t ray cast against static objects anymore but other triggers colliders still work with the ray cast.

The Code in question is strait out of the example “platform_character_controller.js”:

            // fire ray down and see if it hits another entity
        context.systems.rigidbody.raycastFirst(raycastStart, raycastEnd, function (result) {
            if (result.entity) {
                this.onGround = true;
                this.groundEntity = result.entity;
                this.groundPos = result.point;
                if (this.animationState === STATE_JUMPING) {
                    this.land();
                }
                if (wasOnGround) {
                    this.fallTimer = this.jumpGraceTime;
                }
            }
        }.bind(this));

This bug happened first a few days ago, around the time when the new Editor was introduced.
What maybe could be interesting, I use physic masks and groups to filter collisions.

best regards
HummingSwordsman

Do you have simple scene where we can reproduce the bug?

Sorry I tried to reproduce the bug in a simple scene but if I go further I would reproduce the old scene.
So there seem to be some thing other in the Scene that produces wired behavior.

It could be that the project maybe look familiar. :wink:

Simple Project (without bug)
https://playcanvas.com/project/343313/code

Complex Project (with bug)
https://playcanvas.com/project/341302/code

To reproduce the bug.
Collect the Point over the “lavapit” and than it is no longer possible to jump on normal ground.
Press G For invincibility mode.

As always I assume I did something very simple, very wrong.

edit1:

Ok I test a bit around and the bug happens when I enable the entity’s later at run time. So it doesn’t seam it has anything to do with the new editor. That was actually only a coincidence.

edit2:

Ok I could some what reproduce the bug in the simple test scene.
https://playcanvas.com/editor/scene/363969

I found out that disabling and Enabling in the same function does somthing evil.
As soon as I added those lines in the LateActivate.js an error happens at runtime:

                children[i].enabled = false;
                children[i].enabled = true;

edit3:
Short update, I moved the loadlevel function for the first level out of the postInitialize methode. That fixed my Problem .