I find the Niagara data channel writer to be unreliable. It’s not writing to the data channel until I open the data channel asset and change any setting. After that it starts to work, but only until I change level or restart the editor. (see attached video)
If the niagara system gets disabled by a niagara effect type and reactivated it also stops working until you change something in the NDC asset.
Hmm that does look to be a bug somewhere. I’ll try to reproduce here but the fastest path would be if you can upload an example project that demonstrates the issues and I’ll take a look.
This is only in editor right? PIE or cooking this map works as expected or does that also fail?
I’m going to put in a fix for the issue when a listener has completed while a writer holds onto the cell reference.
Incoming data will reactivate spawned systems.
You can locally apply to test if you need.
Replacing the map base tick with this.
I’ve placed this on a CVar so it can be toggled off if there is wider fallout.
void FNDCMapEntryBase::Tick(float DeltaTime, ETickingGroup TickGroup, FNiagaraWorldManager* OwningWorld, const FNDCMapKey& Key)
{
if (Data)
{
const int32 NumPublishRequests = Data->ConsumePublishRequests(Owner, TickGroup);
if (NDCMapLocal::bRestartCompletedReceivers && NumPublishRequests > 0 && Data->HasData())
{
// Writers can retain this entry after its receivers complete, so new data must wake them.
for (UNiagaraComponent* Comp : SpawnedComponents)
{
if (::IsValid(Comp) && Comp->IsComplete())
{
Comp->Activate();
}
}
}
}
}
I think I found the issue, though it’s still a weird behavior.
If I use the global mode for the NDC and put the listener system in the map along with the writer it now works in a more reliable way.
I’m not sure if this is the expected way to use it?
Remaining issue is that if the system gets culled by an effect type, then it stops working forever in the editor mode, but it seems to work fine in PIE.