- Home /
Charging a fireball to get a bigger and badder one!
I already have the basics of LMB to deploy a fireball. Now I wanted to go more in-depth into charging. I was wondering how I can have that when you hold down the LMB for a bit, you get a larger fireball that has a different tag attached to it and can be used for different reasons.
Can anyone give me a hand?
Answer by kat0r · Feb 03, 2013 at 06:21 PM
Instead of instantly firing the fireball on ButtonDown, you save the time. Then, when ButtonUp gets triggered, you calculate the difference between now and the saved time, and if that is over a certain value, fire a bigger fireball.
Also, don't forget to set a cap or else this will get op pretty quick. So, max cast(holding down) could be just 2.0s max and it can never get bigger. Also, you may want to add a visual feature to this so the player knows when to let go, or when the fireball is "maxed out".
Excellent! Thank you very much guys - It is perfectly functional now! Amazing forum with amazing people - Amazing service as well.
Your answer
Follow this Question
Related Questions
Brackeys Inventory System doubts... 2 Answers
How do you add a power gauge to a shooting script. 1 Answer
Decrease 'Charge' of characters spotlight over time 3 Answers
my car loses power over time? : o 0 Answers
Throwing Spheres 1 Answer