I’m trying to develop an FPS melee weapon system similar to Dark Messiah: Of Might And Magic.
I’m building the functionality to charge an attack, and my main issue is I’m able to charge a new attack while doing a previous attack, which messes up both my charge and attack montages.
What I’m trying to do is get the Triggered Seconds here:
To only count up while my bool “ableToCharge” is true. As it is, it’s always going up, so even if I gate it, as soon as the gate is open, you have a fully charged attack ready to go.
How would I go about only having that variable increase based on my bool? Or is there some smarter way to go about it in the enhanced input system itself?
If you do not wish to charge a second attack then create a bool variable say isCharging.
Once you start charging an attack set the variable to true, then check with a branch node. If true dont allow new charging. If false start new charging.
Release the isCharging bool to false on completion of the attack.
That doesn’t work, as soon as the isCharging bool is true, it sets the variable to the elapsed seconds as it will have been counting up the whole time regardless. That’s what I’ve tried to do, but without getting at the elapsed seconds itself I’m not sure how to.
ie it will still be counting “elapsed seconds” on false of isCharging, and when isCharging is true, if elapsed seconds has been 2 seconds, it will immediately set an attack as fully charged.
Nope; because I’m not trying to automatically fire an attack when it reaches a correct value, it fires only on released.
If it’s not charged enough, it aborts the attack entirely, and if it’s overly charged I have a curve that it pulls lower damage from.
This doesn’t get me any closer to being able to alter the triggered seconds value, which is what it feels like I need to be able to do. It needs to not increase while I am performing an attack, or charging an attack.
i thought the idea was to get the elapsed time to find when the charge is complete? sorry if i misunderstood that.
Your problem is using the Triggered output, it repeats on hold down. I found this in my use. You need the start,ongoing,complete and maybe cancelled if that is relevant hooked up with elapsedseconds i believe.
Let me know if you are still stuck i will try recreating a similar graph and see .