I’m trying to implement an arrow to point at a specific direction.
For that, I extended AActor and declared the UArrowComponent:
UPROPERTY(VisibleDefaultsOnly, Category = Navigation) TSubobjectPtr<class UArrowComponent> ArrowComponent;
I also declared a member in my character to manage the arrow (and set the default to my AMyArrow in characters blueprint):
UPROPERTY(EditDefaultsOnly, Category = Navigation) TSubclassOf<class AMyArrow> MyArrowClass;
When I try to spawn the arrow, the object appears in the outliner, but is not visible in the scene.
World->SpawnActor<AMyArrow>(ANaviArrow::StaticClass(), SpawnLocation, SpawnRotation);
When I create a blueprint of AMyArrow and drag&drop it, everything is fine.
What am I missing?
I fixed my problem.
In my character blueprint there was no class assigned to MyArrowClass. To do this, I had to change the category because it was not visible in defaults (I guess “Navigation” is some kind of reserved by UE). Then I was able to choose a blueprint for MyArrowClass.