LogoLogo
What's new?StatusMSquared
  • Morpheus Platform Documentation
  • What is Morpheus Platform?
    • Glossary
    • Interoperability
    • Support
    • EULA
  • Firewall Problems
  • CREATION
    • Unreal Development
      • Get Started
        • Download the Editor
        • Upload Content
        • Creating your Own Map
        • Morpheus Base Project
        • Differences from Unreal
          • Character Configuration
        • Morpheus Networking
          • Introduction to Morpheus Networking
          • Network Levels
          • Replicated Properties
          • RPCs
          • Morpheus Render Targets
          • Morpheus Array
          • Networking FAQ
          • Replicating Sublevels
      • Editor Versions
      • Performance Guarantees
      • Features & Guides
        • Example Plugin
          • Nameplates
          • In-Game Roles
          • Resizing
        • Actor Pooling
        • Audio
        • Avatars
          • Creating an Avatar
          • Attachments
            • MML Attachments
          • Custom Animation Variables
          • Importing an NFT Collection
          • Capsules and Mesh Transforms
        • Bots
        • Chat
          • Unreal Text Chat
        • Control Panels
          • Control Panel Configuration
          • DJ Booth Mission Control
          • Observer Controls
        • Crowd Audio
        • Crowd Rendering
          • Legacy Animated Crowd
            • Animated Crowd Console Commands
            • Attaching static meshes to crowd members
          • Crowd Materials
          • Performance Parameters
          • Live Config Settings
          • Crowd Animation
            • Crowd Anim Blueprint
              • User Guide - Crowd Anim Blueprint
              • Reference Guide - ABP Nodes
                • Animation Playback
                • States and State Machines
                • Variables
                • Transitions
                • Special
                • Blends
                • Additional Notes
        • Helpers & Extras
          • "Instanced Objects" in Blueprints
          • Objects with "world context"
          • Making DataAsset classes
          • Duplicate Objects
          • The Bootflow Subsystem
          • The "Wait For Condition" System
          • Advanced Graphics Settings
          • Listening to Inputs on UObjects
          • Morpheus UserID
          • World Services
          • M2Extras: Skins System
        • Loading Screen
        • Live Config
          • Editing for a World
          • Editing Locally
          • Default Settings
          • Accessing via Blueprint
          • Adding New Settings
          • Overriding Defaults
          • Using Arrays
        • MML
        • Motion Capture
        • Networking
        • Notifications
        • Raycastable Crowd
        • Singletons
        • Streaming & Multiplatform
          • GFN on Mobile
        • UI
          • "UI Mode"
        • User Collections
          • Creating a New Object Definition
          • Accessing from Unreal
            • Creating Objects Definitions
            • Transfer Objects
            • User Collection Views
            • Receiving Updates
        • Video Players
          • Embedded Video Player
          • Millicast video streaming
            • How to Setup an In-Game Video Stream
            • Picture-in-Picture mode
          • Streaming Video Player
            • How to Setup a URL Video Player
            • Picture-in-Picture mode
        • Visual Debugging
          • Inspector
        • Web UI
        • Online Services
          • KV Store Service
        • Web Requests
          • Http Requests
            • Legacy HTTP Nodes
          • JSON Handling
          • WebSockets
          • Identity Validation
          • Allowed External URLs
          • Walkthrough Example
            • Example Counter Service
        • World Travel
          • World Travel in the Editor
        • Avatar Physics Assets
        • Action Gameplay Helper Components
      • Workflows
        • Upgrade the Editor
        • Editing Project Settings
        • Profiling
        • Marketplace Importing
        • Extra Workflows
          • Setup Play-in-Editor
          • Setup Local Asset Validation
          • Adding Gameplay Tags
          • Validating Game Assets
          • Custom Connection Modes
          • Connect Editor to a World
          • Common Issues
      • Best Practices
    • Worlds
      • Invite Players
        • Setting Role Groups
      • Persistent Worlds
      • Always on Worlds
    • Running Events
      • Large Scale Events - Checklist
      • Anti-Cheat (EAC)
      • Player Entry
        • React Native
        • Steam
        • Hardware Requirements
      • Broadcast
        • OBS Integration
      • Failover
      • Capacity and Queue Management
  • ADMINS
    • Access Control
      • Add Metaverse Contributors
      • Create a New Project
    • Pricing
      • Development Support
      • Included Usage & Overages
      • Cloud Streaming
      • Access Modes
      • War Room Support
      • Platform SLA
    • Settings
      • Projects
  • APIs and Tooling
    • API Reference
      • Accounts
      • Events
      • Key/Value Store
      • Organizations
      • Realtime
      • User Profile
      • World Builder
      • Worlds
    • Template Web App
      • Moderation
    • Pixel Streaming
    • Launcher
  • Integrations
    • Analytics
      • Send Events from Web
      • Send Events from Unreal
    • Chat
      • Integrate Pubnub with your Unreal Project
      • Add Moderation to Chat
Powered by GitBook
On this page
  • Overview
  • How it works
  • The Widget itself
  • Where To Find It

Was this helpful?

  1. CREATION
  2. Unreal Development
  3. Features & Guides
  4. Interactions
  5. Examples

Custom Widget Spawner

How to show something other than the standard option menu

Last updated 11 months ago

Was this helpful?

Note that the tools demonstrated in this page are accessible from MSquared v20

Experimental - Customers are encouraged to test and use this feature in their experiences, but it may still require some additional support

Overview

When using interactables, you may want to use the standard options menu available but in some cases you may wish to display your own custom widget (such as a visual representation for a vending machine). This page will detail how to create that, by walking you through our example object BP_Example_Interaction_WidgetSpawner.

How it works

Below are the steps to re-create this example object.

  1. Create an Actor you wish to have spawn a widget on interaction

  2. Add the M2_Interactable component

  3. Right click the interactable component -> Add event -> InitializeInteract

  4. If you require the standard interaction menu; Right click the interactable component -> Add event -> OnButtonOptionRequested.

  5. Use InitializeInteract to set ShowMenuOnInteract on the interactable component. Then either open your custom widget or, if needed, dynamically adjust options ready for the standard interaction menu.

  6. If using the standard interaction menu, handle option selected logic in OnButtonOptionRequested.

The Widget itself

It is very important that your widget call CompleteInteractionupon closing, to allow the handler to accurately track it's interaction status.

If you wish your widget to listen to external sources requesting interactions be closed, bind to RequestCloseInteraction on the Interactable Handler.

Where To Find It

Our example of this can be found in the Approachability and Feature Test Gyms, or directly via

/Plugins/M2Unreal/JunoSkypark/Content/ObjectInteraction/Examples/CustomWidgetSpawner

Gif shows a player interacting with an object that toggles between spawning a custom widget, and using the standard interaction menu.
Image shows binding to the OnInteractMenuClosed event on the Interactable handler
Image shows events to toggle the use of a custom widget on/off each time the previous widget closes
Image shows Blueprint Logic for dynamically preparing the standard interaction menu vs opening a custom widget
Image shows event which will be called if an option is selected on the standard interaction menu.
Widget set up to listen for external close requests and to complete the interaction on close.
Image shows where in the Approachability Gym this example is placed