mouse handler for multiple objects

Hello. Help me solve the problem. I have a cube on the scene. I clone them. How and where do I create a script that will create a mouse handler, which when you click on each cube, will return to me exactly the selected primitive.

CreateCube.prototype.initialize = function() {
       var el ='BoxTemplate')
        for(var i = 0; i < 10; i ++){
        var newEl = el.clone() = 'BoxTemplate'+ i
//, this.onMouseDown, newEl)


We have a tutorial on this here:

Hopefully that will help :slight_smile:

1 Like