Open IKhonakhbeeva opened 5 months ago
Looks like the RandomZoneSourceCallback's parameter is typed as Phaser.Types.Math.Vector2Like
whereas the emitRect's getRandomPoint function returns type Phaser.Geom.Point
.
As a workaround you could do something like
const emitRect = new Phaser.Geom.Rectangle();
new Phaser.GameObjects.Particles.Zones.RandomZone({
getRandomPoint: () => emitRect.getRandomPoint()
});
We will address this after the v3.85 release. We're going to remove the Point
class and swap to using Vec2 everywhere instead, which will fix this. Until then, please use the workaround above.
Version
Description
There is a typescript error when I am trying to create RandomZone for ParticlesEmitter.
Example Test Code
Error:
Additional Information