Child Colliding issue

Hello,
I have made a platform and some blocks on it and a cube is moving but when collided with blocks the game will be over.At first it is working fine but when i’m changing the position of the parent with teleport as it has rigidbody , the parent and the child is moving perfectly but collider of the child doesn’t working after the position is changed.
Don’t know why pls help!.

Hi @questo and welcome,

From your description it isn’t clear what the issue may be, could you share a project url to take a look at your scene setup?

https://playcanvas.com/editor/scene/1000449

@questo If you want it to stop moving and teleport then move again just do this.


myscript.prototype.initialize = function (){
     this.entity.collision('collisionstart', this.onCollision, this);
     this.oldTS = this.app.timeScale;
}

myscript.prototype.onCollsion = function(result){
      if(result.other.name == 'NameofBlock'){
         // not sure if I'm doing the settimeout part right
         setTimeout(function(){
            this.app.timeScale = 0.0;
            this.rigidbody.teleport(0,0,0);
         },5000);
        this.app.timescale = this.oldTS;
      }
}
1 Like

when I changed the position of parent ,the colliders of childs is not working but the collider of parent is working. If we don’t change the position then both the colliders(i.e.colliders of the parent and child) are working fine.