How to solve the problem that 2D interface cannot click hotspot?

I added a remote pole to the project, inspired by PlayCanvas 3D HTML5 Game Engine
This case is particularly good!
But there were some hot spots in my original project, these hot spots won’t click.
Does anyone know how to solve this?
project link: Overview | Dashboard | test | PlayCanvas | 3D HTML5 & WebGL Game Engine

Hi @leooooooo,

How are you handling picking? Are you using raycasts?

If that’s the case then you need to add collision components to your entities that require picking.

yes,using raycasts

I’m not quite sure what you’re saying, but I added the collision component to the hot spot,it doesn’t work

The project is still under development and documentation is still waiting to be written.

If you want to use it ahead of time while it’s in ‘preview’, you will need to commit to understanding the code in the project.

At the moment, the input area of the joystick is defined by the element group in the root of the template:

That group for the left joystick is the left half of the screen.

touch-joystick.js is currently calling stopPropagation on all the input events to prevent events from being used in the ‘world’. In this case, your raycasts in hotspot.js that are listening for mouse events.

You can either remove these function calls or make the input area smaller for the joysticks

I make the input area smaller for the joysticks,but it doesn’t work

and remove stopPropagation function doesn’t work too

If you remove the joysticks from the scene, do you still have the same issue?

If so, you have other issues with your hotspots

If I remove joystick, it clicks normally

Do you know where the hot spot is going wrong?

Just forked your project, hotspots work fine with the joysticks enabled

how did u do it?just enabled the joysticks and player at the same time?

I think I know where the problem is.thx :slight_smile:

All I did was fork your project and enabled the joysticks in the scene.

I disable the mouse lock on the camera movement as that was interfering a bit