Please help I have no idea what to do... prefabs, switch, scripts?

Hello,

Currently, I have 2 player prefabs(a blue and a red), each with their own bullet attached. They can move left and right. One player is on the screen at a time. The blue player can only shoot blue targets and red player can only shoot red targets.

However, I would like the blue player to turn, after shooting 3 of its targets, into the red player and vice versa…

I tried an enable/disable script. This is a problem, because 1.) it was triggered on the space key and 2.) the player would not switch from blue to red in the same position. The red would simply appear where I had placed it on the screen in the beginning, instead of “following” the blue player or looking like the blue player turned into the red player.

Please help, Ive been searching for a long time on how to do this. Maybe Im just bad with the terminology, because Im new. Thank you.

Could you make them the same object, and then swap the visuals and stuff? Like you can make a system where you can say player.SetColor() or something and your logic will handle swapping colors and behavior.

To keep the same system, it sounds like you need your player objects to match the position/rotation of the current player object when the swap happens.

I guess another option would be to make the movable player object a parent object, and then you can keep the different player visuals as child objects, which you can set active or inactive at will.

What you could do is use a enum to track the state of your game. So you can determine who’s turn it is. Then if its not a certain players turn just set that players gameobject and targets to be not active in the scene.