Dear Epic,
Hi there!
I wanted to make a dynamic array of TSubobjectPtr for my actor, to store a variety of different collision shapes, only one of which would be active at a time.
So I wrote this:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Abatron Wall")
TArray < TSubobjectPtr < UStaticMeshComponent > > MorphCollisions222;
This compiles perfectly!
#Crash On Editor Load
After compiling, when I load editor, I get this crash:
!Id:2f33e7f1183c0ad9152e06fe66b1204d
Unknown exception - code 00000001 (first/second not available)
Cast of ArrayProperty //Script//Abatron.WallNeutral:MorphCollisions222 to UObjectProperty failed
KERNELBASE + 40541 bytes
UE4Editor_Core + 3095292 bytes
UE4Editor_Core + 1661738 bytes
UE4Editor_CoreUObject + 357979 bytes
UE4Editor_CoreUObject + 1256721 bytes
UE4Editor_CoreUObject + 380685 bytes
UE4Editor_CoreUObject + 1514444 bytes
UE4Editor_CoreUObject + 1417170 bytes
UE4Editor_CoreUObject + 409866 bytes
UE4Editor_Core + 494127 bytes
UE4Editor_Core + 2174794 bytes
UE4Editor_Projects + 77027 bytes
UE4Editor_Projects + 77565 bytes
UE4Editor!FEngineLoop::LoadStartupModules() + 71 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.4\engine\source\runtime\launch\private\launchengineloop.cpp:1772]
UE4Editor!FEngineLoop::PreInit() + 10981 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.4\engine\source\runtime\launch\private\launchengineloop.cpp:1329]
UE4Editor!GuardedMain() + 236 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.4\engine\source\runtime\launch\private\launch.cpp:112]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.4\engine\source\runtime\launch\private\windows\launchwindows.cpp:125]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.4\engine\source\runtime\launch\private\windows\launchwindows.cpp:201]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]
#The Work Around
The work around I developed was to use a static array instead
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Abatron Wall")
TSubobjectPtr<UStaticMeshComponent> MorphCollisions[MORPH_MAX];
#Editor Drag-Duplicate Bug
But when I try to drag - duplicate this actor with static component array in the level,
It can’t duplicate the static array components and then they are invalid on the partially created drag-created actors.
I dont know if it is even possible for the current drag-duplicate implementation to handle my static array of TSubobjectPtr
and I have had problems with custom C++ actor components and the drag duplicate current implementation
#Suggestion
Why dont you fix the drag-duplicate (using translate widget) to use the same method as when you drag from content browser?
#Reason
When I drag from the content browser, the actor with static array of TSubobjectPtr works perfectly!
#