Now that we have a place to store the mana, we can use it a couple of ways; we could use it to prevent the spell casting motion from even starting the animation or we can change how the spell itself works.
In this example, we’ll let the spell animation happen. However, we won’t let the spell actually do anything. To do this, we need to modify the spell to test if there’s enough mana to cast the spell. None of the current spells do this. So, you have to copy and modify each spell individually.
In this example, we’ll create a copy of the “Magic Missile” spell and modify it to use mana.