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
          • 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
          • đŸ–Ĩī¸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
    • đŸ–Ĩī¸API Reference
      • Accounts
      • Events
      • Key/Value Store
      • Organizations
      • Realtime
      • User Profile
      • World Builder
      • Worlds
    • đŸ’ģTemplate Web App
      • đŸ’ĸModeration
    • 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
  • Enabling attachments in the crowd
  • Adding to the mesh store asset
  • Add to the mesh store dynamically
  • Adding attachments to characters
  • Customising attachments

Was this helpful?

  1. CREATION
  2. Unreal Development
  3. Features & Guides
  4. Avatars

Attachments

Having attachments to allow gameplay.

PreviousCreating an AvatarNextMML Attachments

Last updated 6 days ago

Was this helpful?

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

Overview

Projects can socket static mesh attachments to player characters, for example weapons, glow sticks, or other accessories.

This page describes the process for attaching Unreal StaticMesh assets. You can also use attachments defined in MML - for details see.

This system is designed for more gameplay-like attachments, but if you just want cosmetic attachments, they can be done via the M² Avatar System (see ).

Enabling attachments in the crowd

To use an attachment with the crowd system, the mesh must be registered with the crowd Mesh Store. There are two options here - either specifying the meshes directly in the asset, or dynamically adding them at map start-up.

Each attachment is added along with a joint and an offset transform. If you want the same mesh attached in multiple places (e.g. a weapon that can be held in either hand) then it must be added twice as two separate attachments.

Adding to the mesh store asset

For this method you need to create your own mesh store asset, and reference it from your J_PawnSetAsset. For v35 and prior you must add every attachment mesh that will ever be drawn in the crowd. You must also specify the bone (or socket) name that the mesh will be attached to.

Add to the mesh store dynamically

This step is only required for v35 and prior. v36 and onwards do not need the meshes to be added in advance and this step can be skipped.

Currently all meshes must be added before the first crowd member actor is created. The simplest way to do this is in the BeginPlay event of an actor placed directly in your level, for example in a custom "attachment manager" singleton.

Dynamically adding to the mesh store method is preferable as you can for example automatically add meshes specified in other assets, and it removes the need to maintain the mesh store asset separately.

  • Set up your actor to implement the ISkeletalCrowdMeshProviderInterface interface

  • Call USkeletalCrowdMeshStoreSubsystem::RegisterCrowdMeshProvider before any crowd has been created (for example in the BeginPlay)

  • Override AddMeshesToStore and call AddMesh on the MeshStoreSubsystem for every mesh that you want to use in the crowd.

There is an existing asset BP_AttachmentManagerExample you can use for reference, or even use directly (subclass it to add some logic, or edit the CrowdMeshes field on an instance to add your meshes).

Adding attachments to characters

Now your meshes are registered for use in the crowd, you can add them to the player characters in the game. For this you should use the AddAttachment and RemoveAttachment functions on the Morpheus Actor's M2M_CharacterAssetComponent. The attachment will then automatically be applied to the character, whether it's the crowd or full actor, and regardless of the character type (modular character, MML, or default mesh).

Note that attachments are NOT REPLICATED. Automatic replication of all possible attachment states would add significant overhead, and would be wasteful on most projects. Therefore it is up to projects to replicate their own state. This may be as simple as a single background integer specifying which item is equipped - in the OnRep, simply call RemoveAttachment with the previously equipped item and AddAttachment with the new one.

The Add and Remove functions have a Reload Character option. If you're making multiple calls to add and/or remove attachments to a character, it's more efficient to only reload the character on the final call. The character visuals won't be updated until it's reloaded.

The Attachment Static Mesh, Attachment Socket and Attachment Transform passed in is the same as the one passed to the mesh store - to prevent errors it's best to have a central source of attachments for using in both cases.

From v25.0.0 attachment are limited to 20 per character. Earlier versions had a limit of 4.

After adding an attachment to a character, we receive a FM2_StaticMeshAttachmentHandle which we can cache to later retrieve this attachment or the attached Mesh. Be aware that passing in a null mesh, or a mesh which has already been attached, will return an invalid handle, so be careful not to overwrite any previously saved handle.

Customising attachments

If you have access to a valid attachment handle for the attachment you are hoping to customise, you can pass that and an FLinearColor to "Set Custom Color for Attachment" on your M2M_CharacterAssetComponent. As with adding/removing attachments, these changes will not be visible until the character has been reloaded and the changes are not replicated automatically.

Once a Blueprint has been created to set your custom value, we need to ensure that the attachment is able to use this value. To do that we must:

  • Ensure the static mesh has a material that can process the custom data

To use the custom data your material will need the MF_SkeletalCrowdPerMeshCustomDataRGB node, which we then pass to a VertexInterpolator node. The value attached to "Default Value (V3)" should be named "Custom Value" to coincide with how the data is processed behind the scenes.

Once set up correctly, you should see changes to attachments reflected in LOD 0 and Crowd Actors for all clients told to update this data.

The bubble example here is from within BPM_Combat_PlayerCharacter which is part of the content. It may serve as a useful reference point, but due to the experimental nature of that content it could be subject to change at any time.

🎮
📚
🎭
https://docs.msquared.io/tutorials-and-features/action-gameplay
MML Attachment
Example of adding and removing an attachment
Example of using an FM2_StaticMeshAttachmentHandle to retrieve an attached mesh
Image shows example of how one might update the colour of an attachment
Example of a material set up to handle custom data for attachments
Video shows how customising an attachment may appear in an experience
Attachments