How to add items on roblox's context menu?

I am trying to make a plugin, and I need to add a Item/function to the selection context menu (when you right click a selected instance in the explorer:


I took a look into CreatePluginMenu, but in the API Reference, it just says how to create those menus, and also does not show how to open them when you right click a instance in explorer. I need to know, if doing that is possible, if so how?

Thanks!

1 Like

To my knowledge, this function does not add to the current Studio context menus, it creates a new context menu for exclusive use with your own plugins.

You’d bind the ShowAsync method to a MouseButton2Click event in your own plugins.

See the context menu of the official animation editor plugin for an example.

1 Like

Wouldn’t MouseButton2Click open the menu everytime I press right click, no matter if I am am not hovering the mouse on the object?

Well you’d bind it to the UI elements where you want the context menu to be effective, e.g. over specific ImageButtons