Topic: Hide a character in background if he/she is fighting

I think i saw something like this before, but i can't seem to find it.

Basically, that's it, how can i have a character in the stage, but hide it if now or both players are using it.

Thanks!!

Me encontraste en un negro camino como un peregrino sin rumbo ni fe, pero la luz de tus ojos divinos cambió mi suerte por dicha y placer.

Re: Hide a character in background if he/she is fighting

Should be a relatively simple code to do. Just look for the name of the character current at play and enable/disable the character in the background if the name is the same.

string backgroundCharacterName = "Alan"

void Start()
{
    if (UFE.config.player1Character.characterName == backgroundCharacterName ||
        UFE.config.player2Character.characterName == backgroundCharacterName){
                GameObject bgChar = GameObject.Find(backgroundCharacterName); // Or make a reference to the game object
                bgChar.enabled = false;
    }
}
Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.