Rigging Mana Slider
I am using Spellcasting Package.. Plus I am Using Mana With The Spell Casting Motion Pack
So I have a Question ?
Anyone know how to rig the Magic Missile Mana Spell to the Mana Bar ?
So No Comments wow
No one knows
The Mana Bar is typically a user interface image. It grows and shrinks because you tell it what percentage or number the mana value currently is.
I explain how to get the mana value in this post:
I also explain how to use the mana value in spells.
If you mean only allow the Magic Missile Mana Spell to cast if there mana, I show that in the post above.
I’ve added the “Test Mana” node to see if we have enough mana. So, I add a “Test Attribute Int” node and renamed it. As you can imagine, the attribute we’ll test is if the “Mana” attribute is >= 10.
If you mean take mana away from the mana pool when the spell is cast, that's shown in the post too.
If the “Test Mana” node succeeds, we need to reduce the Mana attribute by 10 since we’re casting the spell. We do that with the “Set Attribute” node that I renamed.
So, I’m not sure what you mean by “rig the Magic Missile Mana Spell to the Mana Bar”. If you can be more specific, I’ll try to help more.
Will its been 3 Months and still no answer to my Question - My Question it how do I link my Mana Bar to my Spells so when I fire off a Spell it redoes the
amount of Mana I have
PS Is Tim doing ok I haven't Heard from him
@solarmanjc I would probably take the approach of basing your spells off of a custom class that inherits from Spell. You would define the mana cost of the spell in that custom class. You would then build a custom component which inherits from SpellInventory, which would contain all of the logic for checking if the caster has sufficient mana before proceeding with casting the spell. I think that this would ultimately be a lot less working that building that logic in every single spell's node editor.
There is a Player HUD prefab under Assets/MotionController/Content/Resources/UI that provides a workable example for hooking up to a spell bar (you could even re-use this prefab and just change the color and attribute name that it checks). It uses a Basic Combatant HUD component, which listens for changes on a specific attribute and then updates the UI graphic.