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) {
                if (wasOnGround) {
                    this.fallTimer = this.jumpGraceTime;

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

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)

Complex Project (with bug)

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.


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.


Ok I could some what reproduce the bug in the simple test scene.

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;

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