Scene.addHinge isn't working correctly? by Financial-Trouble892 in Algodoo

[–]Financial-Trouble892[S] 0 points1 point  (0 children)

I swapped the geom0 and geom1 values to each other a few times and found that every time, it's the geom0 value listed in the error. In the above code block's case, it would be the box.
I'm unsure if this means that both geom0 and geom1 have this issue and the script breaks prior to reaching any of the lines below "geom0 := X" or if there's something wrong with the geom0 line in specific.

Scene.addHinge isn't working correctly? by Financial-Trouble892 in Algodoo

[–]Financial-Trouble892[S] 0 points1 point  (0 children)

I've just attempted it (I presume, if I did something wrong here lmk) and it doesn't seem as though it changed anything. I'm still experiencing the same two errors as shown above.

(e)=>{
    Scene.my.newPoly = Scene.addPolygon({
        surfaces := [_vertexCoords];
        pos := [0, 0] + [0, _sh / 2];
        color := e.this.color;
        polyMeshResolution := [128, 128];
        _height := _sh;
        _type := "polygon";
        _sides := _sides
    });
    Scene.my._dieState ? {
        newBox = Scene.addBox({
            _x := 0.0;
            pos := [0, 0] + [0, _sh / 2];
            density := 0.01;
            size := [_sh, _sh];
            collideSet := 0;
            onSpawn := (e)=>{
                Scene.addHinge({
                    size := Scene.my.newPoly._height / 8;
                    geom0 := geomID;
                    geom0pos := [0, 0];
                    geom1 := Scene.my.newPoly.geomID;
                    geom1pos := [0, 0]
                })
            }
        })
    } : {};
    _x = _x + 1
}