Swap Character Controller based on Health

Title says it all. I am really knew to coding, but the Unity Cookie tutorials are helping me understand things. Think of it like Ghouls’n’Goblins where as you take hits you lose bits of armour. Well I want to make it so the character is limited in movement when he has all his armour on and when his armour is gone he can move alot.

I guess since I will be using different models with different sized collision detection I would have to write separate character controllers scripts for each model and have a script on an Empty Game object that swaps out said Models+Character Controller scripts? So i guess the question would be, how do I go about swapping out the different Models and character controllers.

I assume it would be an if statement based on the variable I set for the Health Points and a GetComponent for the scripts. But I am not sure how to swap the models.

  1. Destroy the old player object, and instantiate the new player object in its place. I Personally would not go with the option.
  2. Have a single controller with a ‘speed’ variable. Make both models a child of the controller object and switch between their visibility.

You do not need to have different character controllers. You need to have one parent game object with a character controller and you can have several different meshes childed to that Parent Object. Depending on which mesh is active you then adjust speed accordingly to the parent object that has the character controller. The childed meshes do not need anything except a mesh renderer. Hope this helps get you started