This crash in CustomizableObjectSystem::TickInternal is one we’ve experienced semi-regularly in our project usually when I recompile our character BP. I was able to repro this crash in vanilla UE5.6 MutableSample project. Unfortunately, it doesn’t occur 100% but I was able to get it a 4 times following the above steps. Though I’ve had to restart the Editor sometimes and recreate a new character BP just to get it.
I don’t understand how we got into a situation where some UsagePrivate is null, while we iterate through UCustomizableObjectInstanceUsage instances… since I’m only creating 1 in this example.
Not sure if I’m missed something but I’m basing this on the sample I’ve found in AInfinite::SpawnInstances() (line 220-224).
I get an access violation in UCustomizableObjectSystem::TickInternal (~line 3997 UsagePrivate is null) when compiling the character BP that uses Mutables, and it appears related to the use of CustomizableObjectInstanceUsage. I was able to repro this in plain UE5.6 with the MutableSample project.
Create a new Character BP
Add a CustomizableObject variable and set it to CO_Character from the sample
In ConstructionScript (see image)
call Parent ConstructionScript
CustomizableObject->Compile
CustimizableObject->CreateInstance
CustomizableObjectInstance->SetRandom
Construct CustomizableObjectInstanceUsage
COIUsage->AttachTo(Mesh)
COIUsage->SetCustomizableObjectInstance
COIUsage->SetComponentName(“Body”)
COIUsage->UpdateSkeletalMeshAsync
As I’m constructing this graph, it can crash if you compile at any step after (3.5). It is not 100% but happens quite regularly. Try Compiling after each step from (3.5) on.
There are times where I can construct the whole function without any issues and I can see the body in the Viewport.
We made a fix to UCustomizableObjectSystemPrivate::UpdateStats() that could address this issue. This would be in CL:43726563 in your perforce branch. If you can’t see that then:
I was still unable to get this to happen. I am curious if you are using the method above to build your character setups? I have a few concerns with this repro and some reasons as to why I think your are hitting the crash.
If you are using the construction script method for applying your customizable objects you run the risk of:
The construction script may take place before your skeletal mesh is prepared and so setting properties on child object before the parent is complete could run into issues like crashes in this case.
Construction scripts do not run in cooked builds. They really aren’t intended for this type of customization effort, they really are meant for static placements in a level.
Even though I can’t reproduce this, I think the issue is happening because the skeletal mesh is not ready in time based on the construction event. Is there a specifc reason you’re using this creation method?
Hi Dustin, thanks for getting back to me. Unfortunately, the code in that CL did not seem to fix the problem for me. CustomizableObjectInstanceUsage was apparently valid, but UsagePrivate was still NULL.
I have downloaded & tested on vanilla UE5.6.1 and even with the code change I was still getting this access violation. In fact, I have found a repro that’s happening 100% for me:
Create the BP character as originally described (above)
Add a child SkeletalMeshComponent under the default Mesh component.
To crash: select the child skeletalmesh and then find the “Use Attach Parent Bound” flag and toggle it. Compile BP and it should crash.
No, one of our artists started experimenting with Mutables in construction script and I was able to repro the bug this way for this report. I’m actually doing the work in a component’s InitializeComponent(), but we’re encountering that null UsagePrivate access violation.
Is there any issue with setting up Skeletal meshes during InitializeComponent()?
Potentially, the order of completion for components being ready and if they are dependent on eachother is not guarenteed, so if you’re attempting to access data that is not available before the customizable object is complete you can run into issues as well.
Do you have a snippet example of how you’re setting that up in code and what might be depending on the customizable component?
No, one of our artists started experimenting with Mutables in construction script