Possesing multiple pawns with a logic not working :((((

Hey everyone. I’m doing a small game project and I’ve faced a problem that I can’t solve. There are two pawns in the level and you can switch between them. Pawn switching logic is inside the player controller class.


and it works fine.

There is a simple function that allows uncontrolled pawns to follow the active pawn.

Every time I start a game - the “follow” function works until the moment I switch the pawn. After switching back - you still can run the “follow” logic and the blueprint shows that everything works, but the pawn is not moving. It looks like after switching between pawns - it loses something - I can’t even describe it. Please help me to figure out the problem, I might have done something wrong.

  1. I’ve already tried to make pawns as separate parent classes - but the same problem.
  2. This is a new controller class.
  3. I’ve tried also adding a follow function to the player controller class firing it up from there and then transferring “Steering Input” to pawn - but it doesn’t work properly :frowning:

Hey @Nessins!

So the problem is that when you unpossess something, it no longer has a controller. You need to assign an AI controller to the unpossessed pawn after the Unpossess node! :slight_smile:

Should the AI controller contain any logic inside? Should it be the same as in the player controller? How do assign it? thank you for your response

Here’s a forum post on just that!

For now the basic AI_Controller class one will do, no need for special functions if they’re on the character and working- because that’s what is already happening before you possess them. Everything is assigned a controller by default if they are pawn or character class- what’s happening is you’re removing that to add in the player controller, but not replacing it when you move the player controller out. I promise you, once you mess with it a bit it will make so much sense!

thanks a lot i’ll try it asap and let u know :slight_smile: thanks for a help

Thank you a lot for the help. The problem was exactly as you described. It’s a bit tricky, but as soon as you understand that AI_controller is an actor - everything goes smoothly :)) My big appreciation.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.