Hi,
In my implementation I need to modify location of two static mesh actors using some logic implemented in some actor class. One way to find a reference to the static mesh actors seems to be using the TActorIterator over UWorld. Is there a simpler way to find an actor similar to using FObjectFinder in Constructors ?
Many thanks !
Cheers,
Shailen
Actor Iterator really is quite fast,
but if you really want something faster than that
Just create two c++ AStaticMeshActor* references in your blueprinted controller or character class and use the level blueprint to fill them.
click on the shoes/SMAs in the world and right click in level blueprint to add them
then get your controller and cast it to your version and fill the refs.
I presume you are doing most of your work in the C++ so that is why I am proposing this method.
Rama
PS: ActorIterator really is quite fast, the above is just to satisfy your question
You CAN find Actors by their Tag, but the UE4 lead programmer said that was not really the intended way to find actors at runtime.
/** See if this actor contains the supplied tag */
UFUNCTION(BlueprintCallable, Category="Misc")
bool HasTag(FName Tag) const;
I prefer to do a
ActorItr->GetName() == "TheNameISetInEditor"
direct, single FString comparison
Many thanks ! I will stick with Actor Iterators then. It is good to know this other workaround though