Need to create a system that allows player to switch between 4 onfield characters

Godot Version



I’m new to programming and I’ve been surviving off of picking apart tutorials I follow to figure out what does what and why. I’ve hit a roadblock because the thing I need to do doesnt exactly have any tutorials and I haven’t figured out a way to do it myself yet. Can someone give me a rough idea on how to do something like this so I can do more research?

I need a system that, when the start button is pressed, puts four characters on field and allows the player to switch between which one they’re controlling. when they aren’t being controlled, the other characters will follow the character the player is controlling

I don’t know of any tutorials but I could maybe give you a brief rundown on how I would proceed.

You need a character that can be controlled by player or the CPU. This would require a control node that could be plugged into the player character (as a child) and modify its state to walk. This would allow you to activate player control or CPU control.

You will need a autoload or master system that wait for the switch character key and orchestra the changing of the control nodes.

The CPU actor, this will probably need talk to the master system to ask where the controlled player is and it will formulate a path to walk towards player (using the same mechanism player control works). There are some built in tools Godot has for navigation, as well as many different ways to tackle it. There will be some heuristics involved but that is another discussion.

There are probably some other nice things to have like Player selection highlight. But those are bonus features.

There can be many ways to do this as a whole, but it all depends on how you want it to “look and feel” and depending on those requirements my approach may not be the best fit.