Hi,
I am trying to make some procedural alghoritms in C++, but I can’t get access to landscape (to read hightmap or align objects to it). I was trying something like this:
First: because of reflection system i highly recommend to not do that in constructor
Ues reflection system will read and compile constructors for blueprint system when engine start.
If youcall getworld there or try to get any actor will cause possiblr crash.
Override OnConstruction(FTransform Transform) function in your actor,which will execute only when actor are placed on level, or moved or something
Second: i recommend to use UGameplayStatistics::GetAllActorOfClass
Which will give back an actor array what are placed in world
Third: if this will be some kind of editor extra feature and will not used ingame/runtime i suggest to start learn how to extend editor.
Because Editor has LOT OF feature to search/select/deselect actors from current level, which can be usefull if you want extend editor…
Of course for this you need do Plugin instead of simple project some doc about that: https://docs.unrealengine.com/latest/INT/Videos/PLZlv_N0_O1ga0aV9jVqJgog0VWz1cLL5f/zg_VstBxDi8/
Thank you for your answer. Well, I didn’t want it to work in this place I am only trying to resolve my problem, no matter where, but thank you so much for your tips for the future.