Need to Switch Control Between Objects

Hello again!

I would like to be able to switch user control between one character to another, e.g. from driving a vehicle to moving around the scene with a camera. I assume that States could be used, but I’m not sure how to use them.

Does anyone have any suggestions?

Basically all of your “switchable” objects can be deactivated and activated. These operations switch the state from “usable” to “unusable” (or “active” to inactive" or “enabled” to “disabled”).

The objects do not need a relationship to each other, nor do they need to be implemented the same way.

The switching itself deactivates the object to switch from and activates the object to switch too. It will help if the activation/deactivation operations can be performed the same way on all switchable objects (e.g. by sending a message, or setting a property).

How to: enter a vehicle or how to: switch controls
CommandPipeline with selection and context manager

Thank you very much, Monster! I will look at those links.