"Mouse Over" problem on overlay collection (UPBGE 0.33+)

Hi, I’m trying to add some kind of menú as overlay scene, but the “Mouse Over” does not cast the ray on the overlay, it works if the mouse is over the object in the main camera even if the object is not visible. but if the mouse is over the object in the overlay, it does not work. Is there a way to fix this?
I’ve tried it in UPBGE 0.33 and 0.35 with no success.

I’ve attached a blend with the minimum setup

Overlay Test.blend (841.0 KB)

Here’s an update:
I’ve found an option in the camera tab on Properties window, named “Game Overlay Mouse Control” that fix that problem, and mouse over events works on the overlay camera, but this makes the mouse over events to stop in the main camera.

3 Likes

Hello mr.Opheroth.

Could you advise me how to fix it.
I try doing as you said but nothing change.

here is my blend file. would you mind checking what I’m missing?
game_menu.blend (1.0 MB)

thank you


Okay. I understand the problem. after testing in very simple version.
it is a bug in version 0.3. I tried download version 0.41 and there is no problem about overlay mouse control. such a waste of time.

thank you.

Don’t worry, I’ve tested it too in version 0.36 and still works here. I’m glad it worked fine for you too.

for the ui - I recomend using a single object that has ‘geometry nodes’ that emit the UI.

each vertex can be a element, and the attributes packed in the vertex can be used to set what to emit, we can encode the vertex index of the emission vertex into the element,

later we can use mouse ray we make ourselves (BVHTREE) to get hit face → from here we can look up the stored index → use it to make ui choices
https://docs.blender.org/api/current/bpy.types.Depsgraph.html
we can access attributes like this

depsgraph = context.evaluated_depsgraph_get()
obj = kx_object.blenderObject
eval_ob = ob.evaluated_get(depsgraph)

attributes = eval_ob.data.attributes
value = attributes['Stored_index'].data[index].value #for a int or float
vector = attributes['Stored_vector'].data[index].vector#for a int or float

so we have main cam do mouse over on main scene,

and our own custom mouse ray on overlay.