Is it possible to activate the textbutton over which the mouse cursor is hovering?

Greetings,

I’m making a radial menu like you see in many games such as GTA V and Dishonored. I’ve been able to recreate everything except the activation of the item over which the mouse is hovering when the menu is closed.

I want the player to open menu, move mouse to desired item, then release menu button thus activating the button that was highlighted by the cursor hovering over it

I know this is possible with a gamepad but i’ve not been able to find anything about the mouse, please advise if you have any info

Thanks for your time

Use TextButton.MouseEnter:Connect(function() if you want to make a hover function

that is what i am using right now, i should have pointed it out in the post.

2 issues with this

1 the menu starts as small then expands when opened, thus you can accidentally activate it

2 mouse enter fires immediately upon entering the button area, while i want it to activate upon releasing the menu button

Try this if the script is inside the textButton

script.Parent.MouseMoved:Connect(function()

Btw: I dont know if this is what you are looking for.

Hey, read up on this. They is a developer hub page for radical menus :smile:

thank you but this does not offer solutions hence why i made this post in the first place

but i figured it out so i’ll write it here and mark it a solution for others

I made an empty variable i.e. local Spell

upon opening the menu i connected the buttons to a MouseEnter event, upon firing the event changes the value of Spell to the name of the item in the button

then upon closing the menu( a separate function) it fires the event that corresponds to that name (i.e. if the Spell = Fireball, it fires the event called Fireball)
and thus it activates the last hovered button before closing the menu

1 Like