Let's say I have a character controller on my player that is typically controlled using a script that reads human inputs and manipulates it using those inputs. But what if I also have a scene in my game in which an enemy momentarily takes control of the player, during which human inputs should be ignored? Similarly, what if the player activates a skill using an input, but then that skill's logic takes control of the player's behavior for a given amount of time? Maybe a debugger wants to control an entity during testing; there are many possibilities.

I am confused on how I should model these relationships in code, and am looking for some suggestions.



You must log in to answer this question.

Browse other questions tagged .