[SOLVED] Screen/buttons are not responding in engine-only project

For some unknown reason screen and buttons are not responding in engine-only project, its 1-1 compared to editor project, perhaps there’s something wrong in a way I load input?

        const app = new pc.Application(canvas, {
            mouse: new pc.Mouse(document.body),
            keyboard: new pc.Keyboard(window),
			touch: new pc.TouchDevice(document.body),
			input: new pc.ElementInput(canvas),
			graphicsDeviceOptions: {
				antialias: true,
				powerPreference: 'high-performance',
				alpha: true

I can confirm that touch events are registered/added

		input: new pc.ElementInput(canvas),

pc.app.elementInput returns null, any ideas? :thinking:

Hi @Newbie_Coder,

I think it should be:

elementInput: new pc.ElementInput(canvas),

Check this example: PlayCanvas Examples

1 Like

Oh… For some reason I thought name: new pc… was just for a reference purposes, completely forgot that it’s actually a name of pc.app.property/object. Thanks!

1 Like