Possess A Pawn Then Possess The Player After It IS Destroyed

So I’m making a gamer where you can spawn a projectile (a Shuriken) take control of it and move it left and right, I have the spawning working and you possess it however when it hits a wall and is destroyed I don’t know how to make it repossess the player.

Where do I go from here?

All help is appreciated.

You should not need to spawn a new controller just posssess the “Shuriken” and call “Possess” on the original Pawn OnDestroy of the “Shuriken”. I have not testet it but it should work like that.

for simplicity you may want to create a variable that is a reference to the original player pawn for when you have to re-posses. also make sure you call the possession just prior to destroying the shuriken actor

This is what I’ve been trying and nothing seems to work.
Am I just not casting it right or is there something not so obvious i should be doing?

Get player pawn gets the currently possessed pawn so you can’t use that. Do something like Thompson suggest with saving the character in a variable somewhere so you can repossess it using that reference.

Okay so how would i do that? I’ve just tried using the variable type - controller - object reference but i can’t like it to the player character, when i did the actor reference it said actor object reference is not compatible with controller object reference. thanks for pointing out the get player pawn I didn’t know that.

It is the pawn you need to save a reference too, not the controller. You can keep the same controller throughout the game.

The picture below shows a method to accomplish what your looking for. It was done completely in the player controller. on the input being pressed it gets the players character and saves it to the variable originalcharacter which is of the type character. at almost the same time it spawns an actor and possesses it. upon this new actor being destroyed the original actor is possessed. I left determining the location to spawn the new actor up to you because thats something unique to you and because im lazy right now.

Thank you this helped a lot.