When working through this lecture one of the things I spotted was that we are doing this;
PlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
AIController = Cast<AShooterAIController>(OwnerComp.GetAIOwner());
over and over again in the TickNode. Whilst I appreciate Sam mentions that the frequency of this tick was less that the frame tick, it still felt like it was unncessary to repeatedly run those lines of code.
I tried to be clever. I failed.
So, in both cases I created a private variable in the header file, and the went about setting them once before they were then used within the TickNode.
I tried the Constructor as a place to put them, although thereās a little warning about the GetWorld() (and other) virtual methods being called at compile time, and obviously I needed the Owner.Comp which wasnāt availabe in the constructor - so I figured that wasnāt going to work.
I then discovered the OnBecomeRelevant method. The documentation suggests that it is called when the node becomes active, which kinda sounded like what I wanted, e.g just fire this once, or at least only once each time that node become active. That didnāt work either.
In each case, both variables = nullptr, so when TickNode runs, the desired code/outcome doesnāt occur.
It strikes me there must be a way to this but fumbling around the documentation and Google searches Iāve not found anything yet.
Any ideas? Would be interested so as to extend my learning a bit here.