sinbad / SPUD

Steve's Persistent Unreal Data library
MIT License
300 stars 44 forks source link

ChildActorComponent Support #60

Open mmhtx opened 11 months ago

mmhtx commented 11 months ago

Hello,

SPUD is an excellent library and I hope to use it in my project. I've been prototyping out some of my use cases and I've hit a couple of complications. ChildActorComponents are currently causing me some trouble.

When I put a ChildActorComponent on an actor and Save/Load, the result is that two instances of the CAC are created. What appears to be happening is that when the parent is created, it creates its own instance of the child, then your actor loader loads a second instance, free floating. The child instantiated by the parent is vanilla, with none of the runtime changes, (its "SaveGame" properties are default) while the free floating Child Actor has the runtime changes applied.

I'm poking a bit at the source code to see how I can resolve this, but are there any suggested techniques to use ChildActorComponents with SPUD?

Best Regards,

sinbad commented 11 months ago

I've never actually used child actor components because all the advice I've ever read about them is not to use them. They have a lot of edge cases and everyone seems to suggest creating the result other ways (attaching actors, regular mesh components).

I'm afk (weekend) but if I had to guess I imagine the way child actors get instantiated confuses the detection of runtime vs level actor or something like that. But like everyone else I'd suggest finding ways other than child actor components to achieve your desired result.