Charge Weapon

Ok the sequence fixed the charging but. The delay still will not work. But i see what you mean about this system being confusing. Any ideas on how to simplify it for the player?

Try this. I THINK it will work!

Note: I still use a timeline for the charge counter as it’s easier to understand (timelines define float values by curve, so you don’t have to worry about adjusting for delta seconds) and it makes it simpler to adjust charge time (just adjust the timeline length!) instead of the way you currently do it.

This system should (in theory, I can’t test it since I don’t have any corresponding chargeable projectile):
(a) charge up, and then auto-fire at max charge
(b) prevent charging OR firing until the cooldown has ended (and the system I’m using of closing that gate after firing will ALSO prevent release firing after an auto-fire)
(c) let you press a different button to cancel the charge immediately.
(d) keep track of whether the player is pressing the charge command AT ALL TIMES… info which it uses in this instance to check if he’s still pressing charge when the cooldown is over, at which point it will immediately resume charging a new shot, so he can start charging right after firing without worrying about delaying his input until after the cooldown is finished.

That is Exactly what i have been trying to do :stuck_out_tongue: Thanks. But one question do i have do set any values in the timeline other than creating the float.? Because i only have the float in there right now and it all works perfectly.

The timeline should just have a single float track that goes from zero (or 1, or whatever the minimum charge value should be) to max charge, with its time set to however long you want the duration to be from min charge to max.

You can make it linear, or you can curve it if you want to (for example, maybe it should have a parabolic curve, since longer charges are harder to pull off… Rather than scaling the damage 1, 2, 3, …10, you might go with a curve closer to 1, 1.5, 2, 5, 10, or something, so that the last second of charging increases damage more than the first, that’s up to you to decide based on game balance)

Note, of course, that this system relies on your projectile BP simply taking that charge time / charge level as a constant to adjust size, speed, damage, etc. ONCE when it spawns. Your other system constantly re-set charge time to be equal to delta seconds, so I’m not sure how you were using that data from tick to tick; but this system doesn’t require any of that, the delta second compensation is handled automatically by the timeline. Just give the float track 2 keyframes; one at [Time 0, Value MinCharge] and one at [Time End, Value MaxCharge]

Ok i got it working thanks :D. One last thing do you know how i would make it so that you can see the fireball and watch it grow or change colors based how long its been charged. Like in the skyrim video you can see it forming.

[video]www.youtube.com/watch?v=8I5ifBB_XXc[/video]

I’d use a particle system for the chargeup. This part is a bit trickier since you have to parametrize your particle system (read the documentation, Cascade is pretty complicated and parametrization is NOT super intuitive or easy to explain), but essentially the idea is:

(1) right before you hit the “Play From Start” node of your Timeline, spawn the particle system for charging in the same physical location you’d spawn your projectile.
(2) right after you set the Charge Time variable (i.e being ticked by the Timeline Update pin), update a parameter IN that particle systen which controls things like how large it is, how bright it is, how fast it’s swirling, etc., so it looks like it’s charging up
(3) right before you fire the actual fireball projectile, deactivate the particle system, so that it can decay/fizz out just as the projectile’s fireball particles appear and it will look like the projectile was launched from it.

You COULD try making the chargeup and the projectile the SAME particle system, such as spawning the projectile but preventing it from moving while charging, but with something like fire (which uses a lot of decaying and moving layers and doesn’t have a single underlying mesh) it’d probably be a lot of extra work without looking any different to do it that way.

Ok i did what you said and it get it spawned. Buts its a bit buggy so im not sure i did it right. But it spawns and it stays there for a while even though i have a destroy component.

Sorry this is kind of confusing. I get the emitter to spawn but it stays there while holding the fire button. But its still there after it shoots. the emitter that gets spawned blocks the projectile because it has collison. And it seems to ignore the destroy actor?