- Interactive Menu
- Supported topologies
The interaction menu module provides :
- a very simple menu UI prefab
InteractiveMenu. It contains a title and a place holder to add text or buttons.
- a simple line rendered prefab (
CurveLineRenderer) that can be used to link the interactive menu with the associated object.
InteractiveMenuclass in charge to display the menu that follows the target object. It checks if there is an object between the user and the interactive menu and finds an unobstructed position. The menu is automatically oriented towards the player's camera. It is possible to define the start & end point of the curve line thanks to offset parameters. Also, the menu can be displayed a limited number of times and for a limited time.
How to use it ?
- Add the
InteractiveMenuclass to the grabbable object on which you need an interactive menu,
- Create a menu prefab variant for you needs based on the
InteractiveMenuprefab and choose it as the
Interactive Menu GO. For example :
- Set the
Curve Prefabwith the
CurveLineRendereror any line rendered prefab,
- Define the
Target Objectto be followed by the menu
Interactive Menu parameters
Always Display InteractiveMenu: if true, the menu will always be displayed. Otherwise, the menu will only be displayed a certain number of times (see
Number Of Display Of InteractiveMenuparameter).
Number Of Display Of InteractiveMenu: Set the number of time the menu is displayed (
Always Display InteractiveMenumust be set to false)
Menu Display Duration When Grabbed: the time (in seconds) during which the menu is displayed after the player grab the object
Menu Display Duration When UnGrabbed: the time (in seconds) during which the menu is displayed after the player ungrab the object
Elastic Speed: Control the elasticity of the curve. In other words, it defines how fast the menu follows the object.
Default Menu Offset: Define an offset position for the interactive menu.
Interactive Menu Offset In Focus Mode: Offset to control the interactive menu position when focus mode is enabled.
Start Position Offset: Offset of the first point of the curve. Useful if you don't want the curve to be in direct contact with the menu.
End Position Offset: Offset of the last point of the curve. Useful if you don't want the curve to be in direct contact with the object.
Curve Menu Offset: Offset to control the bezier curve near the menu.
Curve Object Offset: Offset to control the bezier curve near the object.
Obstacle layer: the menu can be displayed in undesirable positions (e.g. in walls). To avoid this, the class uses raycasts to try to find a position where no object obstructs the menu's visibility. You need to define which layers are taken into account in the raycast.
Offset Distance When Menu Touch An Object: offet used to move the menu if an object obstructs the menu's visibility.
A demo scene can be found in
Three cubes with differente
interactivemenu settings can be tested.
This addon latest version is included into the addon project
- shared mode
- Version 1.0.4: Remove InteractiveMenu Action Variant prefab
- Version 1.0.3: Namespace modification
- Version 1.0.2: Reduce the delay to find the rig + add protection in CheckTargetMenuPosition()
- Version 1.0.1: Add demo scene + remove unused assets + add namespace
- Version 1.0.0: First release