I added the following according to the docs
npm i phaser3-rex-plugins
import VirtualJoystick from 'phaser3-rex-plugins/plugins/virtualjoystick.js';
var joystick = scene.plugins.get('rexVirtualJoystick').add(scene, {
x: 100,
y: 100,
//radius: 100,
//base: baseGameObject,
//thumb: thumbGameObject,
// dir: '8dir',
// forceMin: 16,
// fixed: true,
// enable: true
});
I got the following errors :
world.js?5e60:85 Uncaught TypeError: Cannot read properties of undefined (reading ‘get’)
at world.create (world.js?5e60:86:1)
at SceneManager.create (phaser.js?d4ef:100338:1)
at SceneManager.loadComplete (phaser.js?d4ef:100250:1)
at LoaderPlugin.emit (phaser.js?d4ef:1908:1)
at LoaderPlugin.loadComplete (phaser.js?d4ef:196794:1)
at LoaderPlugin.fileProcessComplete (phaser.js?d4ef:196760:1)
at ImageFile.onProcessComplete (phaser.js?d4ef:4961:1)
at Image.data.onload (phaser.js?d4ef:19311:1)