[SOLVED] Problem with renderLine

I want to draw some lines, but I don’t know why it doesn’t work.

My test project: https://playcanvas.com/editor/scene/543655

The lines.js script:

Lines.prototype.update = function(dt) {
    
    var cube = this.app.root.findByName('Box');
    var cubePos = cube.getPosition();
    var rest = new pc.Vec3(0,-5,0);
    
    var start = cubePos;
    var end = rest.add(cubePos);
    var color = new pc.Color(0,0,0);
    this.app.renderLine(start, end, color);
    
};

You have two activated cameras in your hierarchy. This is triggering this issue:

Although it would be nice if this bug was fixed, I suspect you don’t want or need two active cameras in your scene. If you disable or delete ‘Camera’ and leave ‘NormalCamera’, you will see the line.

1 Like

And that is the reason, the new camera, ok, thanks @will!!

1 Like