UMassAgentComponent added to static actor results in Cook failure due to automatic delegate binding for runtime subsystem (MassComponentHitSubsystem)

Hello UDN,

We have identified an issue specifically with MassComponentHitSubsystem which brought us to question whether we are mis-using the system as it was intended, or if there is perhaps a bug in the Mass code.

If you add a MassAgentComponent (either in blueprint or in C++) to a static actor, it will result in this actor being registered automatically with Mass, which results in MassComponentHitSubsystem binding this actor’s capsule component to a delegate which gets serialized into the actor and saved.

The issue is that MassComponentHitSubsystem is a runtime subsystem only, and the actor now has a serialized reference to it outside of runtime.

This causes a cook failure as the actor references a runtime subsystem which doesn’t exist outside of runtime

Error: [CookWorker 0]: /Game/__ExternalActors__/Maps/.../MyActor :
Failed import for MassComponentHitSubsystem /Game/Maps/.../MyMap:MassComponentHitSubsystem_0",
"id":301,"format":"{channel}: {severity}: [CookWorker 0]: 

Looking a bit into MassComponentHitSubsystem, it seems perhaps that the unbind logic never fires for static actors, perhaps because they are not destroyed like runtime spawned actors are.

Our question is: Is it incorrect to use MassAgentComponent on static actors?

Steps to Reproduce

  1. Create a level which uses Mass AI (i.e. has a Mass Spawner Actor)
  2. Add a MassAgentComponent to an actor which is statically placed in the world
    1. The actor should have a CapsuleComponent (collision capsule)
  3. perform a full cook (non-iterative) and see that a Cook error will be produced involving the following error

“Line 48493: {“time”:“2025-10-06T21:42:28”,“level”:“Error”,“message”:“LoadErrors: Error: [CookWorker 0]: /Game/__ExternalActors__/…/ : Failed import for MassComponentHitSubsystem /Game/Maps/…/MyMap:MassComponentHitSubsystem_0”,“id”:301,“format”:”{channel}: {severity}: [CookWorker 0]: "

Hi!

I have tried reproducing this using 5.6, but I do not see any errors in the cook for the MassComponentHitSubsystem from having an actor placed with the config. The MassAgent component should support placing actors in the level with creating their entities based on the entity config at runtime. Do you happen to have any specific traits enabled on the config? Perhaps it is some combinatorics issue we have not seen with having all factors present at one time. It is also possible it was fixed in 5.6, but I am not finding any applicable JIRAs with a quick search.

-James