Projectile needs additional calculation?!

Hi there,

I need a little guidance please.
Here’s a quick info dump so you can make informed suggestions :slight_smile:

I have a Cannon/Mortar style weapon, and a projectile that fires from it, with the length of time the left mouse button is held determining the power given to the projectile. All this works nicely but what I am trying to achieve is having a free look camera behind the mortar so you can look around and rotate the base of the weapon (to get the direction of the weapon) but the pitch is controlled only via a separate key so it does not take pitch information from the camera, but from me pressing a key to raise/lower the elevation of the weapon. I have the raising and lowering key done and working, I have the camera more or less working but I need the calculation of the GUN OFFSET vector (which helps determine where the projectile initially spawns etc) to be calculated in real time, adjusting as I raise/lower the weapon with the key. Does that make sense?

It’s much simpler in video form. I will get a quick video and host it and update the post with it so you may see what I mean!

VIDEO BELOW:

[Mortar Pitch video][1]

I’m sure this is easy for someone?

Okay so I’ve been working on using the camera to control the pitch of the Mortar and I have solved that aspect of it now (see new picture with the script I use).
The problem remains though that I cannot get my projectile to take this new angle into account when spawning and firing.
Come on geniuses, shame me

Ah, I’m disappointed in you UE4 Community!
I have something a bit like what I want but it’s still not right after many hours of trying. Anyone willing to hack this out with me please?

Hello dazuk1978,

I’ll be happy to look into this for you. Could you post all of the blueprint logic about setting up the angle of the “laser” or whatever you would call it that is representing where the cannon ball is suppose to go? That seems to be getting calculated correctly so the ball may need to follow a similar setup.

Also please wait 2 days without a response before bumping your post, unless you have new information of course.

Ah great!
I will gather the info tonight when I am at home and post them here.
Thanks for your help

Hi ,
Below are images from my main pieces of script which control the ball spawning, velocity and trajectory being calculated and then fired. So hopefully in there s the answer to my problems?
I am using 'Projectile Path Tracer from Zack Maxwell on the Marketplace and I didn’t want to post the image of the contents of his Trajectory Calculation Function as I didn’t want to basically give his stuff away for free!
I think it’s most likely something I am doing wrong anyway and hopefully you’ll spot it. Be gentle, I am not an advanced user, just begging, stealing and borrowing as much as I can to get the job done! (not stealing actually, but it sounded good…)

Note: The first image is just an overview so you can see the way it’s structured. I doubt you’ll be able to see any details on that one. The other images are the zoomed in ones of those blueprints.

Thx for any help you can give…
Cheers,
Daz

Hey .
Have you had a chance to look at this yet please?

Thanks

As previously stated, please wait at least 2 days before bumping a post for lack of response. I’ll be taking a look but it may take a bit due to the multitude of work that I have at the moment.

I understand not wanting to show the purchased content but I will say that it seems like that trajectory function is the only reason the trail you have to show where you’re cannon ball is supposed to go is working. You may want to look into how hes doing that calculation and translate it over for your cannon ball seeing as it works for the trajectory visualization.

Hello dazuk1978,

Have you been able to figure anything out from looking at the calculations provided in the Calculate Trajectory node? I would be interested to hear of any progress you’ve made. I’ll be marking this issue as resolved in the meantime for tracking purposes.