Hi all, I would appreciate any help you can give. I cannot figure out why this is not working.
This is what I am trying to achieve:
Seamless camera view when switching between Player Controlled and AI Controlled.
Description of gameplay: As the player, you can move around and choose an object (a tree for example) to hide behind. These are found via a trace, where the viable objects are on a specific trace channel. Once you’ve detected an object that you can hide behind, you press the Q-key which starts the hiding state. This starts by switching the characters control to the AIController, which moves the character to the location and hides, then switches back to the player controller. The whole time this is happening, the camera and spring arm should remain in the same position regardless of the controller, so that to the player, the view is seamless and remains the same.
The switch from PlayerController to AIController works, but I have been struggling to get the camera view to remain the same between the switching. I have read many forums that suggest setting the View Target, which I have done but cannot get right. I have used the function “Set View Target With Blend” from the PlayerController, setting the AI controller as the View Target, then set the “Find Camera Component When View Target” to true and unchecked “Auto Manage Active Camera Target” on the PlayerController instance during gameplay – from what I can tell this is the only way to do it? That has meant that the AI Controller switches to seeing through the characters eyes, however I cannot get it to remain looking through the characters spring arm and camera. I also tried adding a spring arm and camera to my custom AIController class, and this, when I had unchecked “Auto Manage Active Camera Target” did work but the camera was stuck where the character spawned, it did not follow the Actor and I was unable to access the camera and boom arm to set properties that would define this positioning.
I would like to add that I have programmed this in C++ originally and will be adding this functionality in C++ but switched to blueprints so that I could better understand how the Controller management works. I can share blueprints and or code if helpful?