Hi guys, me again! Really quick question…
I have my controls set up in my MyCharacter.cpp within the SetupPlayerInputComponent, so therefore all of my keyboard input needs to go through the MyCharacter class at the moment (quite messy, but is fine for now). So far when I have wanted to manipulate things when I press a button I have been using
for (TActorIterator<ATimeObject> ObjectIter(GetWorld()); ObjectIter; ++ObjectIter) ATimeObject* CurrentTimeObject = *ObjectIter;
which has been serving me well. However, I’m working on AI at the moment and the main thing I seem to have missed is calling classes that don’t need to be created into objects. For example, I don’t want to (and can’t, I think) make an object of AIController within MyCharacter.cpp to allow me to execute the AIController functions.
Is there a way I can set this up so that when I press a button, my MyCharacter class can speak to the AIController class and execute one of it’s functions? I have a feeling it maybe ‘Casting’ which still confuses me.
Thanks a lot!