I followed this tutorial here: https://wiki.unrealengine.com/Multi-…k_Graph_System
And made Tasks that receive a Pointer to a HierarchicalInstancedStaticMeshComponent and a Pointer to a custom Actor Component and when the Task is executed and comes to this line:
// Task properties set through constructor UHierarchicalInstancedStaticMeshComponent * HISM; UDataComponent * Data; // and in DoTask HISM->AddInstance(FTransform(Data->GetLocation(idx)));
it crashes with an “Access violation writing location” message.
I am checking both for != nullptr.
I’ve read that it could be caused by the fact that I’m not using virtual method stubs but I tried making GetLocation virtual and it didn’t fix it.
I split the line up into this:
// DoTask FVector location = Data->GetLocation(idx); FTransform transform = FTransform(location); HISM->AddInstance(transform); // <--- Access violation writing location
And it only crashes in the last line.
Postet it on Answerhub as well: https://answers.unrealengine.com/que…0178/view.html
But as there are not many ppl doing c++ there I was hoping I’d get an answer in the forums.
In the first pic you can see the hierarchy, “VoxelDataRenderThread” is an Actor Component that creates the tasks.
It receives references to the other components (HISM and Data) as shown in the second pic. This happens before the tasks are created.
As of now, I tried moving the AddInstance call into the “VoxelDataRenderThread” (out of the Task) but it didn’t change anything.
Could there be a problem with the way I’m setting the references? Or is it just not possible to call AddInstance from a peer component and I need to somehow move it up once again, to the Actor for example?