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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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