Games crashes when calling a function from another actor class

There are so many ways to setup your pointer.

You can either get your actor instantiated through code that you can either instantiate using a custom AActor class that you have created, or you can get a reference to one of your actor assets by using the normal UPROPERTY(EditAnywhere) AActor* ActorAsset.

If you already have it in a level, drag and the current actor class to the level you want and select your script. From there, you can use the drop-down menu to point to the actor you have in your level.

If that actor exists as a ChildActorComponent in a blueprint class and you want to setup your pointer in a blueprint class, you can also use the blueprint nodes to setup your pointer by adding BlueprintReadWrite to your BackAndForthActor's UPROPERTY. Then you can use the Set BackAndForthActor node to setup your actor.

As I said, there are many ways to do this. See which you’d like to use.