how can i switch gameplay's ?

hi all , i have fps game
I made ​​a GamePlay by mecanim . i want switch gameplay.
I want the players took refuge behind the walls, gameplay changes
For example, when the player is behind the barricades. I can only move left or right or up and sits it.
How can I do this?

tank you

Dumbest possible answer: Through scripting! :wink:

Bit more details: One way would be to add e.g. collider “zones” to areas where the player should be able to take cover. Once inside that zone do your stuff like limiting movement (OnCollisionEnter() or OnTriggerEnter() are your friends in that case).

i know
i can active deactive code
or
i can trigger enter or collision

but i no idea for doit . how can limiting movemet ?

i use mecanim
i must change a animator controller or writ new code for triggers or …

?

You use booleans or enum’s to determine what controls are in use.

i want create fps cover system but ws ad in animatorcontroller have horizontal vertical axis’s
and i create a game play , now i want player attach the walls change controllers and new game play (cover system) is active
is good idea for cover system ? or make with mecanim layer ?

can you show me a example ?