Jump to content

Particles error WebGL


Recommended Posts


I try to create particles that follow a fireball but, it would seem that an error occurs when two particles are present simultaneously.

[.Offscreen-For-WebGL-000001A6882A0050]GL ERROR :GL_INVALID_OPERATION : glDrawArrays: attempt to access out of range vertices in attribute 0

Any idea?

For the code side, each time the player clicks on the left mouse button I create a new object which creates itself the particle.

        this.particle = this.game.add.particles('spark0');
        let angle = this.angleCalc( this.spr.x,this.spr.y,this.startX,this.startY );

            angle: angle,
            speed: {min: 50, max:75},
            quantity: 100,
            lifespan: 100,
            alpha: { start: 1, end: 0 },
            scale: { start: 0.5, end: 0.1 },
            tint: 0xFC3319,
            follow: this.spr            

With only one fireball it works very well (I don't know if it's important but, the tint I applied which is supposed to be red displays blue).

But as soon as several fireballs are present, some are displayed without particles and the error comes.

Did I make a mistake?



Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...