MagiCats
Wiki home
Numbers / Basic

Distance Between

Measures the distance between two units.

Current editor blockBlock ID 38DistanceEntre
Distance Between code block in the MagiCats editor

What it does

Returns the rounded distance between their positions.

Inputs

  • First unit.
  • Second unit.

Try it

If Distance Between Enemy and Player < 5, Attack.

Tips

  • This is the easiest way to make range-based behavior.

Sources

Legacy pages reviewed: DistanceEntre

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