Switch between third person and first person characters

I’m using the first person template to create a Metroid fangame with a Prime-esque setup, and I’m having problems creating the morph ball. I have the blueprint for the morph ball coded and I’m using a player controller blueprint to make the switch between the two. When I press the key to morph, it spawns the morph ball actor but does not destroy the Samus actor, camera does not track the ball and is also restricted to horizontal rotation. Switching after this always locks up the camera completely. This is my player controller BP.

Am I missing something required to tell the game it’s switching to third person? I was certain just switching the actor was enough and the camera used by the actor was what determined perspective.

Hi!, first I’ll tell you how you could make it work with your current setup and then I will give you suggestions that may be useful. Keep in mind I’m updating the engine right know so I cant test your setup or my solution but I hope it can help you.


Solution (I hope):
So lets get to it. in the blueprint above you are destroying the player controller instead of the actor the player controller is controlling. And given that the player controller is destroyed the transform it passes doesn’t exist. From the player controller you should get the controlled pawn and hook it to the destroy actor node.


Suggestions:

  • Instead of the multigate you could use a flip flop node (it will look nicer ^^)
  • Instead of destroying and creating every time the actors, you could try to make the morph ball part of the samus character blueprint. This way you wont have to pass variables like the health between the actors. (Although I think you are using the player controller to hold variables like score, etc)

Hope you find this useful

Ram

Programmer at Unforgiven

I am planning to store the variables in the player controller and manipulate them there, yeah. Having them as multiple characters has made it easier to code them completely I’ve found and keep the tools of the morph ball and of Samus separate from each other, and the collisions have been easier to do with them separate.

I have found out that the camera problem did not stem from this blueprint, though. I’ve got the controls fixed with your answer now but even with the “get controlled pawn” node linked to the destroy node it’s not destroying the actor.

Never mind, I managed to fix it. I swapped the order of the unpossess and destroy nodes and it’s working fine now. Thanks for the help with the other half of the problem, though!