Short Version: The velocity provided by the “Suggest Projectile Velocity” is functioning accurately. However, plugging that Velocity into the “Launch Velocity” input for the “Predict Projectile Path” node results in a path that doesn’t match. See pictures for proof.
Long Version: I’m setting up a method for AI turrets to shoot arcing projectiles at moving targets, so need to predict where the target should be when the arcing projectile would get there. To do so, I needed a launch velocity/angle that would make a projectile moving at a known speed hit the target, and to know how long the projectile will take to get there, which I can figure out from its speed and total path length.
So to start I used the “Suggest Projectile Velocity” node, plugging in the start position, target position, and projectile speed, leaving gravity alone and selecting Favor High Arc.
Then I move onto the “Predict Projectile Path” node, using the same start position and plugging the Toss Velocity from the “Suggest Projectile Velocity” node into Launch Velocity.
Finally I use the Toss Veloctiy to get a pitch rotation for the launcher and spawn a bullet with the preset speed used to calculate everything.
In theory, the debug line of the “Suggest Projectile Velocity” should match up with the debug points created by the “Predict Projectile Path” and the actual path the bullet travels. Unfortunately, only two of these happen, with the “Predict Projectile Path” node’s visuals being inaccurate.
The reason I need these to match (other than the fact that logically they should) is because I’m setting up predictive aiming for moving targets. I need to know the total distance the projectile travels along its arc so I can calculate how long it takes to get there, and then predict where the target will likely be after that amount of time, adjust the aim, and then fire.
I can find the total distance of the arc adding the distances between the projected points along the path, and everything else will fall into place easily, but only if the predicted path is accurate. And right now it’s not, which makes the whole process fall apart.