How can i use Phaser-Raycaster in TS?

I really want to use the ‘Phaser-Raycaster’ plug-in, which does not support TypeScript. Please let me know if you know how to use this in TypeScript.

https://github.com/wiserim/phaser-raycaster

:wave:

Maybe something like

import PhaserRaycaster from 'phaser-raycaster';

class Scene extends Phaser.Scene {
  raycaster: any;
  raycasterPlugin: any;
  // …
}

new Phaser.Game({
  // …
  scene: Scene,
  plugins: {
    scene: [
      {
        key: 'PhaserRaycaster',
        plugin: PhaserRaycaster as Phaser.Plugins.ScenePlugin,
        mapping: 'raycasterPlugin'
      }
    ]
  }
});

thank you!@!@

hi samme!!
I want to implement a circular FOV in the form of the following picture.

I searched a lot, but most of it was about Unity, and then I got to know you. I have tried many things such as reducing the length of the ray while looking at all your shadow cast related codepen, but it is not easy for me to make the code into the form I want.


it’s your codepen.

Can I ask for help if possible?

Did you have any code or source for how to initialize PhaserRaycaster in typescript?

I have really confusing

I declare

raycasterPlugin: PhaserRaycaster

but when I use this.raycasterPlugin.createRaycaster();

it throw error that this.raycasterPlugin have not initialized