Calling a code defined function in blueprints that returns a TWeakObjectPtr causes a crash.
1. Open UE4 Editor
2. Add code to project based on Actor (AMyActor)
3. In the header file add the following:
UFUNCTION(BlueprintCallable, Category="test")
TWeakObjectPtr<AActor> ReturnWeakObject();
4. In the source file add the following:
TWeakObjectPtr<AActor> AMyActor::ReturnWeakObject()
{
auto Actor = GetWorld()->SpawnActor<AStaticMeshActor>();
return TWeakObjectPtr<AActor>(Actor);
}
5. Compile
6. Create blueprint based on AMyActor
7. Enable Input on Begin Play
8. Add WeakObjectPtr node and connect to key press event (T)
9. PIE and press T
Result:
Editor immediately crashes
I am not able to find world outliner how to enable it?
Delay nodes occasionally don't fire the "Completed" output in a nativized build
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
An error occurred while trying to generate project files !?
UE5.0.2 How to resolve error code (Xcode install) when trying to launch UE5.0.2 after install
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.7.3, 4.8 |
Target Fix | 4.8 |
Fix Commit | 2499396 |
---|
Created | Mar 20, 2015 |
---|---|
Resolved | Apr 2, 2015 |
Updated | Apr 27, 2018 |