I am currently trying myself on an AI. I have a Pawn, an AIController and to the latter I added an AIPerception component. Imagine a character where vision and movement direction do not have to coincide (an example I can think of is ArmA2, where you can turn your head independently from your body).
While I can disconnect vision and movement via Blueprint, the direction for the visual stimuli seems to be stuck to the movement direction. This might mean that I have to rethink my way of controlling the character. Or maybe I actually have to tell the AIPerception component that the character is able to move its eyes.
Any ideas how to do this? I wouldn’t be afraid to dive into C++, but I don’t know where to start with this.
The camera is a child of the head. But is the camera in any way relevant for an AI-controlled Pawn? If it was, turning the head should result in turning the direction of sight, too. But that does not happen.
He wants the AI character to look around so that the AIPerception component’s field of view rotates around the AI character. So yes, something like what you posted, but with AIPerception component and no actual camera or anything like that.
Not players but with AI.
In theory, the AI Percetion Component just calls Actor::GetActorEyesViewPoint() of its outer actor which I’ve found to be a bit limiting. If you want independent rotation you might need to do something weird like have two independent actors, where one follows the other (or just modify the source code.
(See AIPerceptionComponent.cpp in GetLocationAndDirection())