How to bind to SkeletalMesh->GetOnMeshChanged
I'm trying to bind a function to SkeletalMesh OnMeshChanged, but I'm having trouble getting my function to bind. My usecase for this function is to be able to update another SkeletalMeshComponent that needs to grab the new skeletal mesh every time the Character's skeletal mesh is changed.
Here's what I have in my .h file:
And here's what's in my .cpp file (in my constructor):
and further down in the file, is the implementation of that method
This compiles, but the editor crashes immediately on launch. I'm familiar with AddDynamic, but that particular function does not seem to be available here. I wasn't sure which of these to use (Add, AddUObject, AddUFunction, etc.)
Does anyone have any pointers on how I can attach my method to the OnMeshChanged event?
is indeed the correct way to bind a function to a multicast delegate but I believe you have to it in the 'BeginPlay' of your class, not in the constructor.
You can also have a look at the example provided in the Unreal Engine 4 Scripting with C++ Cookbook.
Follow this question
Once you sign in you will be able to subscribe for any updates here