How to control already created actor with other actor ? [SOLVED]

Hi ! I’m a beginner and I am searching to modify the location/rotation of an actor with an other actor but I can not find anything on the internet about it.

I don’t want to use a actorcomponent and to attach them in the existing actor, and I don’t want to create the actor to control it after, i want to control it with the other actor. It’s possible ?

I hope I am understandable, my English is not very good :frowning:

Ty ! :slight_smile:

Huh? Either I am not understanding this question or the answer is “get a reference” to the actor you want to control from within the controlling actor.

If that other actor spawns the actor with SpawnActor, then SpawnActor return the pointer to the actor, just store it in variable so you can communicate with that actor later.

If you already have them on the level it very simple actully, just make EditInstanceOnly property:

UPROPERTY(EditInstanceOnly, Category="Related Actors")
AOtherActor* OtherActor;

This will create property in property editor for that in which you can select actor and endine will set the pointer to that actor, this allows to link actors together in level editor. Keep in mind that if None will be selected( which is by default) it will be null pointer, so if you do this always remember to check if property is not nullptr or else your actor will crash editor if you forget to set property.

It works perfectly, thank you!

(And if a beginner like me reads this: It is necessary to select in the editor the actor once added in the world and to select in the tab “Details” the targeted actor.)