Spear throwing Projectile

im looking for someone who’s kind enough to make me a projectile that acts like an spear. Basicly i have one done myself but it isnt doing my game well in that way i made it and im rly not into math stuff so i can make it as i need it to. So basicly i need a projectile that fly’s further the longer you hold the attack button and flying in a Z curve towards the hit location which is supposed to be the mouse location, and draw a line to the hit location so you can see where it will land.

Would be cool if somesome could make that for me =)

hey there here is a tutorial, i think from there you can achieve what you want.

Thx for the reply, but i tried that alrdy but i dont get that to work :frowning:

should it be physics based or calculated in blueprints?

Calculated in blueprints sir

For some reason you must move first for it to work.

I made blueprint actor that draws trajectory, one is near wall, another is added to player character as child.
One added to character will trace mouse cursor direction (rotating is done in character bp)

Have not done holding button to change velocity or angle.

Ok sir, i will take a look at this. Thank you for the time you spend on this !!

I dont mid if i pass on the charging part, might be better without it anway

Holy cow now im completly confused :stuck_out_tongue: I going to add some “gameplay” footage so maybe its somehow easier to explain what i mean, not thats completly wrong what you did there, but im kinda confused what isgoing on in your blueprint :smiley:

You wanted to draw trajectory for projectile towards mouse target. I helped with math.

Just add control for velocity and angle, then set those in BP_Trajectory and tell it to fire drawing event.

Ok there you go >

The arrow is of the start of the projectile, the longer i hold my mouse, the more value my projectile speed variable will get, after releasing my mouse, the speed will multiplied with the projectile velocity :


The projectile itself has nothing but a rotation on it, so it looks its flying in a curve.

But since the way i have it done right now, makes it pretty hard to hit something. So i would like to make it simple and make the projectile just hit the mouseposition with a curve ( with a maximum reachable range ) that changes depending on how far away to location is.

Or if i would still use the charging option, i need some kind of trace, more or less like you did so the player knows how the projectile will fly toward the aim position.

Sorry for all the trouble :confused:

Nvm guys its Solved, i learned there is a suggest projectile velocity -.- looks like i just have to give up the charging stuff but well, it works almost as i want it to. Thx for the help again nawrot and sorry for wasting your time there