MagiCats
Wiki home
Controls / Basic

Else If

Checks another condition after an If did not run.

Current editor blockBlock ID 33ElseIf
Else If code block in the MagiCats editor

What it does

Runs only if the previous If or Else If in the chain did not pass.

Inputs

  • Condition block.
  • Blocks snapped inside.

Try it

If Player is close, Attack. Else If Player is far, Follow.

Tips

  • Use it to choose one behavior from several options.

Sources

Legacy pages reviewed: ElseIf

Code checked: MagiCats_UnityProject/Assets/Scripts/Blocks/ContentFonction.cs, MagiCats_UnityProject/Assets/Scripts/Blocks/BlockManager.cs