Charge Weapon

Right, but the trace doesn’t work by magic. You can’t just run it and expect the BP to guess what you want to do with it. Like I said, in the screenshot above, your Out Hit pin isn’t connected to anything. So you’re performing the trace, doing NOTHING with the result, and then doing the next thing…? Or is that picture just misleading? Because if that’s actually what your BP looks like, that’s where the problem is; you’re performing the trace to determine which direction to shoot the projectile (which, by the way, why do that when you can just use the Get Actor Forward Vector or Get Control Rotation to determine which way to shoot?) but when the trace gives you that information, you aren’t actually passing it on to the projectile.

Hi,

What is the origin for your character? I would expect what you are seeing to happen if the origin for the character actor is at ground level (i.e at/near feet level)

I’m certainly no expert though, so could be wrong… Might be worth checking though?

  • Mark

Before i made this thread that is how i had it setup. And it worked fine it fired the direction i was looking at. But after making the changes earlier in this thread it has stopped working like that. So i’m trying to figure out why that is.I removed the line trace and it has not changed anything.

Can you post a screenshot of the BP for the projectile AND for the pins connected to the spawner?

With a problem like this it could be that you’re spawning it wrong OR that the projectile itself is wrong, like the projectile movement component is configured weird or you’re telling it to fire downward and it’s colliding with the ground or something.

It would probably also help if you had pics or video of what it’s actually doing in-game. Like, there are quite a few things that could be happening here is my point, I can’t help you figure out which ones aren’t working unless I have more info…

I want it to where my cursor is. That is why i have the linetrace. Here is my blueprint and a video showing how it just spawns on the ground and not where im pointing.

Okay, so what you’re doing is spawning the fireball at a position defined to be 250 (290?) Units away from the player in the direction he’s facing.

So: are you wanting it to spawn UNDER the cursor? Like, just appear on whatever the cursor is resting on? Or are you trying to make it work like the Skyrim fire spell, where it spawns in front of the player and flies forward until it hits something (theoretically, what the cursor is pointing at)?

The skyrim version

Fireball blueprint have a proyectile component?

Yes it does.

Well, first, sorry RhythmScript :p, but imo the best to know recharge time is use game time, soo:

Create a fake spawm point inside of camera:

Now only need pin the position to the spawm trasnform:

BTW you can see the example using a “Game time” function. :cool:

Thank you! This is exactly what i have been trying to do.How can i add a cooldown to this. I tried to add a delay at the end and have it open the gate after it was done but that didnt work.

Put a new gate between F press and Sequence, create a “then 2” to close the gate, and the delay open the gate.

That doesn’t seem to be working. :frowning:

edit: I wrote this in response to your response that you wanted the fireball to work like skyrim. I don’t know about all that Camera Spawn Point stuff, I’ve never done anything that way since I tend to do third-person stuff and connecting spawns to cameras in third-person is a bad idea generally.

But to make your spawned fireball work like Skyrim, that’s pretty simple. Just before making the Transform for the projectile spawn, use a “Vector + Vector” node and add some Z value to scale the fireball up vertically to the position you want it to be conjured from.

Also make sure your fireball has a properly configured projectile component (eg set to ignore gravity, moving in the right direction, doesn’t collide with invisible geometry like player capsules and the like)

Thanks i got it to work now. But now im trying to add a 2 second delay on it but its not working. Got and ideas?.

You mean delay its trajectory? Like, spawn it, have it wait 2 seconds, and then fly forward?

That can’t be handled in this BP. It has to be handled in the fireball’s BP. You’ll need to use the Event Begin Play node to first freeze its movement (I don’t know how much of a Projectile Movement Component can be adjusted at runtime, but my guess is you can change the projectile velocity), then hit the delay, then increase its movement speed to the desired amount.

I mean a cooldown. For example I fire a fireball then have to wait 3seconds before i can fire another one.

OH! okay, I can see what you’re going for with that BP then; force-close the gate after firing, and then don’t let it open again until the delay is finished, right?

At a glance, that seems like it ought to work. What specifically is the problem (knowing how it’s going wrong will help me troubleshoot it)? Is it that it always fires right away? Is it that once you’ve fired once the “cooldown” never ends and you can’t fire again?

Right now i fire it and then i can fire it again right away. I want it to be where i fire then i have to wait lets say 3seconds before im able to fire it again.

I THINK I see the problem. Let me hazard a guess: you can fire again right away, but you CAN’T actually build up a charge again, right?

Try this: make firing the projectile hit a sequence node. First, it will close the gate after “Release” (same as right-click), THEN it will hit the delay that eventually reopens the first gate.

Right now your delay prevents you from charging until the cooldown is over, but your release command will still fire, so you can fire uncharged shots. If you gate that shut, you won’t be able to do either… Though once the cooldown is over and you can initiate the charge again, it will hit the sequence that re-opens the release key.

I caution you, though: you may find this setup frustrates the player. If they hold charge before that cooldown window is open, it won’t register… And even after the cooldown is over, it still won’t register, as you won’t have generated a NEW “Pressed” event. IMO the intuitive way is for holding the button to “prime” a charge, so that once the cooldown is over, it will start charging right away if you pressed the key before the cooldown was finished.