Moving TopDownCharacter with AIController triggered by PlayerController
Hi all, I have a little Problem with AIController in a RTS-Game-Approach. The TopDown-Template didnt suite my needs so i came along **this** Article frome Gustavo Maciel and tried it like in the following picture.
I created a SpectatorPawn with a CameraComponent, which is not attached to the Character like in the Topdown-Template and made it starting Pawn. All good on this side. My problem is on the AiController/CharacterPawn side. My intend was to put a SetupInputComponent into PlayerController. Through Mouseclick the PC was supposed to trigger a Function in AIController. AIController was supposed to decide what happens with this click and how it moves the Character or where. But i cant trigger Functions in AIController. I just cant simply initialise an Object from AICOntroller in my PlayerController to start the Movement.
Now i dived into this and saw, that a lot of stuff in or with AIController is working from the start of the game, or directly after spawning a Character and possessing it. what actually makes sense, because AIController should be independent from Player input. So is my approach wrong or am i just stuck or getting something wrong? Is there a way calling AIController like getting Controller or PlayerCHaracter? How can i get it working, like its shown on the Picture?
After some months im still fairly noobish with UE4 and C++, I hope i didnt miss an obvious thing here.
Follow this question
Once you sign in you will be able to subscribe for any updates here