Will the projectile curve always be the same? (i.e same distance and velocity) Will it curve in single axis or multiple?
For single axis:
You can create a float curve in your project under content browser that defines the curve you would like to apply to your projectile over time. You can then use a get float from curve function that you pass in a variable for the time since projectile was fired to determine the delta to apply to that axis
EDIT: Function is Get Float Value where target is CurveFloat
For multiple axis:
You can create a vector curve in your project under content browser that defines the curve for all (2 or 3) axis that must have curve applied over time. You can then use a get vector from curve function that you pass in your time since projectile fired variable and get the XYZ deltas to be applied to your projectile
EDIT: Function is Get Vector Value where target is CurveVector
As an example of what Im talking about consider the following (assumes 1 game unit = 1 cm).
If you have a sling shot weapon that fires a projectile 30 meters in 10 seconds that the maximum height of the projectile is 20 meters you can create a curvefloat that has a Y axis that goes from 0 to 2000, and an X axis that goes from 0 to 3000.
Y is referencing the height of your projectile and X is referencing distance from the weapon after being fired.
For this example we will have 3 keys on your curve (defining points), 1 at (0,0) 1 at (1500, 2000) and 1 at (3000, 0). This will give you an inverted V (crude but suitable for demonstration) once you have this working you can add as many keys as defines a nice curve.
Now, if you track time from the weapon firing you know the projectile finishes its curve in 10 seconds so you can find the distanceRatio to use
distanceRatio = (timeSinceFired seconds / 10 seconds) * 3000
Now if you feed that distanceRatio into your “get float value” function identified above it will give you a Y axis value which is the height the projectile should be at based on the current distanceRatio, and your distanceRatio is your X axis value.
This pretty much defines a curve that will identify XY coordinates over time for this specific trajectory of 30m in 10s.
Obviously you would need to modify the XY coordinates based on the vector of the direction the weapon is facing.
Bonus tip:
This would work fine for that single trajectory for that single weapon but you could extend this to work for any trajectory that has this kind of firing dynamic.
If you create a curvefloat that has a Y axis from 0 to 1 and an X axis from 0 to 1 and you create an inverted U type curve, you can use this (lets call it a normalized curve) for any weapon that defines its own maxHeight of projectile at top of curve, maxDistance from weapon when projection hits ground, maxTime projectile will be in air before hitting ground.
You would calculate for a given weapon a timeRatio
timeRatio= timeSinceFired seconds / maxTime
Feed that into your “get float value” function on your curve, lets call the output floatOut (which will be between 0 and 1)
Your current Y for the projectile would be floatOut * maxHeight
Your current X for the projectile would be timeRatio * maxDistance
Again you would need to modify these coordinates based on the direction vector of your weapon
Creating the actual blueprint mechanism:
If you have a variable in your blueprint of type CurveFloat you can define it to be a CurveFloat you have created in content browser.
Drag the out pin and search for Get Float Value
The other input pin is the distanceRatio or timeRatio i describe above
The output pin is floatOut