LogoLogo
API Status
  • 👋Welcome
  • 🌐What is Morpheus Platform?
    • Interoperability
  • â„šī¸Help
    • 📗Glossary
    • 🆘Support
    • Firewall problems
    • EULA
  • 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
      • 📚Features & Guides
        • 📒Example Plugin
          • Nameplates
          • In-game roles
        • 🏊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
        • 💠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
          • đŸ–Ĩī¸Version History
        • âš™ī¸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
      • 📚Useful Reading
        • ⭐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 Reqs
      • đŸŽĨBroadcast
        • 📹OBS Integration
      • Failover
      • 🏁Capacity And Queue Management
  • ADMINS
    • đŸ‘ĒAccess Control
      • Adding metaverse contributors
      • Creating a new project
    • 💲Pricing
      • Development Support
      • Included Usage & Overages
      • Cloud Streaming
      • Access Modes
      • War Room Support
      • Platform SLA
    • âš™ī¸Settings
      • đŸ—ƒī¸Projects
  • APIs and Tooling
    • 👩‍đŸ’ģIntroduction
    • đŸ–Ĩī¸API Reference
      • Accounts
      • Datasources
      • Events
      • Key/Value Store
      • Organizations
      • Realtime
      • Sessions
      • User Profile
      • World Builder
      • Worlds
    • đŸ“ĻFrontend SDKs
      • 📄Version History
      • Pixel Streaming
    • 🚀Launcher
  • Integrations
    • 📊Analytics
      • Sending events from web
      • 🎮Sending Events from Unreal
    • đŸ’ŦChat
      • 🎮Integrating Pubnub with your Unreal Project
      • Adding 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 10 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