Issue:
C++ OnConstruction functionality does not work after you restart your project. Unless you cut and paste the function out, recompile the project, and paste it back in and recompile.
Expected:
OnConstruction functionality will still work on project restart.
Reproducibility:
5/5 times.
**Steps to reproduce: (Contains code fragments, will require some extra work on reproducers side) **
- Declare editable boolean e.g.:
UPROPERTY(EditAnywhere, Category = MyCategory)
bool bMyBool;
- Create custom C++ Actor and declare/implement OnConstruction function e.g.:
void AMyActor::OnConstruction(const FTransform &Transform)
{
Super::OnConstruction(Transform);
if(bMyBool)
myStaticMesh->SetMaterial(0, myMaterial1);
else
myStaticMesh->SetMaterial(0, myMaterial2);
}
-
Place custom actor in UnrealEd level. Set bMyBool to both true and false. Notice the material of the Static Mesh changes.
-
Save and restart project. Repeat step 3, notice the material no long changes i.e. construction functionality does not work.
-
Cut the OnConstruction function out of the custom actor class. Recompile project. Paste the OnConstruction function back in. Recompile project.
Notice it now works as expected.
If you have any queries or this is confirmed to be a bug let me know
Cheers,
Josh Caratelli