Firezown
(Firezown)
September 26, 2014, 9:17pm
8
Okay, so for the first bit:
On your projectile BP, create a variable (Int in my example case) and click the Eye icon next to it. Also, in its details pane, check “expose on spawn”. What this does is tells Unreal “this variable is not just used by the BP internally, but I should be able to set it when I create an instance of this actor”. That will make that variable appear as a pin when you select that BP in the Spawn Actor drop down (you may need to delete and recreate the node after compiling the projectile BP).
BUUUUUUUUT, that only matters if the projectile is chargeable! i.e. it changes (does more damage, gets bigger, whatever) the longer you charge it. It sounds like you want more of a windup-type attack, where you have to hold the button down for a certain amount of time to prep the shot and releasing early causes the attack to fail. You would do that completely differently.
To do that, you would make your Timeline have the length of the warmup/chargeup, and connect its “finish” pin to the projectile spawner. You would tell the Input Action pressed to “Play from Start” and the released to “Stop”. So every time you press the button, it plays a countdown (from the beginning) and then fires the projectile at the end of that countdown, but if you release it before it gets there, it stops counting down.
Or if you mean “it’s chargeable, but it won’t do anything unless it reaches some minimum charge point”…? Like the tiers are “do nothing, little attack, big attack, huge attack”? In that case, right before the projectile spawner you’d have a branch that checked if the Charge State variable was above a certain amount. If true, it would fire the projectile and reset the charge state… If false, it would just reset the charge state without firing.
Thanks that fixed it!. But there is one thing happening now that is kind of weird. When i hold down the charge button if i hold it down past a certain time it autofires and then when i let go of the button it fires again.Is this something to do with my timeline or what?