Hi everyone!
I’m a beginner with UE4 and UE5. I already got a bit experience with stuff like variable types, widgets, experimented with selfmade actors and the state machine, some data tables and other stuff… but one thing i want to learn simply does not work. I don’t know anyone personal who i could ask.
I tried to ask Aura AI (an AI assistant for UE5) and ChatGPT about how to solve this issue. None of them could fix it. So i hope someone here in the forum could help me learn and understand how unpossessing cameras and actors works.
Here’s a screenshot of how Aura AI and ChatGPT told me to do it.
Please don’t be mad at me if i don’t instantly understand what you mean. I’m still in the beginnings with all that blueprint stuff. Also: i’m not a native speaker in english. There might be some mistakes.
As far as i have understood it so far: there has to be a reference to the actor that is supposed to be possessed again. In my previous project, i tried to use “unpossess”, which didn’t work either. The possess chain works perfectly fine. I’m trying to keep it simply and minimal to avoid the ultimate brain chaos.
Location: “ThirdPersonCharacter”
Purpose: Photo Mode with spectator camera and screenshot button (that screenshot button chain works fine though, so not on the image.)
Keys: 6 for photo mode (temporarily) and P for screenshot.
If someone has a more beginner friendly way for a photo mode, let me know it!
What class is your code running in?
Also, is this single or multiplayer?
Hello!
So i took a look. In the info window of the actor is see that the class is “character”. I’m only familiar with the default mannequin and pawn as actor so far.
Edit: forgot to answer the second question. It’s single player of course. I’m not making a game, i’m just learning the engine.
Should probably implement this in a player controller. Since it’s in the character the input action probably just isn’t being sent down to char when pressed again to exit since the controller no longer owns it once you possess teh spectator.
And for a small performance gain, you might want to skip deleting spectator, and instead just attach it to player then possess it again if valid instead of spawning a new one every time.
Hi illspiritx!
Your solution worked perfectly fine. Thank you very much! Now i have learned how to properly use possess and unpossess and where to put it. I put everything in a new player controller and set that one up in the game mode. 
Finally, after such a long time, it works for the first time ever.
I’ll put every other logic of that type into the same player controller, once my selfmade actors are finished.
Typically you handle all possession in the Game mode. But as a minimum you can do it in the controller class. Never from Character (Pawn).
Was writing out a complete solution using controller and interfaces to keep the code clean.
If yours is working now, good to go.
YW. Glad you got it working. I just wired up a rough version for the possesion logic so it would save the spectator for later, if it helps:
I appreciate your effort, Rev0verDrive. I prefer a simple node setup and solution as beginner. If i ever make a full commercial game, which is highly unlikely, i’d of course try to use the advanced/professional type. I will note your tip about the game mode though!
Solid tip for future development that you should really start using now.
Stay away from the Gets with (Player index) nodes.