Object Smears When Converted To Child

Discussion in 'Technical Discussion' started by tvalleau, Aug 26, 2019.

  1. tvalleau

    tvalleau Boxer

    Joined:
    Jul 28, 2018
    Messages:
    12
    Likes Received:
    3
    I have some cubes, physics objects dropping via gravity, onto a platform that the user slides left and right. They should be captured and rest where they land. Works great most of the time. sometimes they smear when the platform is still, but if the user is moving the platform, they are pretty much guaranteed to smear. It's easy to see in a screen movie, but I can't upload one here, so there are three stills taken from it instead.

    here's the capture code:
    function signal(name, value){
    if(value && !_triggered){
    _triggered = true;
    let comp = this.entity().component('If Collide');
    if(comp){
    let obj = comp.collisionObject();
    obj.addChild(this.entity());
    this.entity().physics().setActive(false);
    }
    anyone know what's going on? seems to smear more when the platform is moving at the time the block hits, but motion is not necessary all the time.

    do I need to remove the physics and work with speed attributes instead?

    (This is a remake of something I did in Unity several years ago.)
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      20.2 KB
      Views:
      11
    • 3.jpg
      3.jpg
      File size:
      20.9 KB
      Views:
      11
  2. PunkPuffin

    PunkPuffin Avid Boxer

    Joined:
    Sep 27, 2018
    Messages:
    285
    Likes Received:
    191
    I recently did something with addChild and had to use this instead of setActive.

    this.entity().physics().setPhysics(false);
     

Share This Page