switching between in game characters

i hope someone can help me

I am trying to create an in game character switch

so you control a character and at the press of a button switch to a nearby character. the original still being there

i did create this at one point but it destroyed the original character and they both need to be on screen

i hope i explained clearly and someone can help
thanks

One way is you use 2 camera.

When you press the button disable the current camera and enable other camera and vice versa.

I think when you change the character you destroy current character!
If you can put your code here!

It would help if you could clarify with a few more details such as the perspective you’re using in your game.

If you’re doing this in a third-person perspective (i.e. not first person) it would just be a matter of having the camera follow a different transform (that of the new player).

If you’re doing this from a first-person perspective, your best bet (as @Milad suggested) is to have one camera per character, positioned as needed, and switch between them depending on who is ‘active’.

Either way, to transfer control between characters would be a matter of

  1. disabling Player 1’s controls
  2. enabling Player 2’s

You’d toggle Behaviour.Enabled for the script you’re using to control the character.