SuggestProjectileVelocity is NOT a bug. Working as intended, and here's why

Just thought I’d make a note here that this does occur as of 4.20.1, and I googled the topic and found that it is not actually a bug. Here’s why:

Source:
https://answers.unrealengine.com/questions/476620/ugameplaystaticssuggestprojectilevelocity-returns.html

TraceFullPath is the default and is working as designed
Essentially what this is saying is that the default value is “TraceFullPath”, which means that the method will trace along the path and look for any collisions, and if it finds one before reaching the exact end point then it will return false. In the case of the AI guns, they can’t hit the spot beneath the player, because the collider on the player’s tank is blocking the trace. In the case of the player, there is something else blocking it, possibly the player’s tank itself.

DoNotTrace works because it doesn’t check for colliders.
By setting it to DoNotTrace, you are essentially telling it to ignore any colliders on the path and just calculate as if nothing is in the way.

FCollisionResponseParams should give you collision info
This parameter seems to be the container for the tracing data and what objects were hit during the trace that caused it to return false.

IgnoreActors TArray parameter
I am under the impression this problem is the reason this parameter exists. If you add the player and AI tanks to this, then it should not return false even with TraceFullPath option, unless some other collider is in the way (like a prop, a projectile with collider, or the terrain).

Video corrections would be a good idea here
Love the videos and work you do, it’s absolutely supurb and a true talent how you can take this complicated engine and somehow feed it into my tiny brain. However, this particular video is misleading in a couple aspects regarding this bug. You can see this lesson’s forum is quite active compared to other lessons because of it. Some points you may want to consider would be…

  1. Making a correction to this video explaining the real reason it doesn’t work.
  2. A separate video explaining how to strip a project down to report bugs, even if it’s just hypothetical.

Optimal Bug Reporting
In reality, the QA teams don’t want your entire project with all code and assets like you’re suggesting in this video. The ideal bug is one in a fresh, empty project with only the bug in it and minimal or no art assets bloating the download and complicating the reproduction of the bug.

If you remake this video, please use the visual debug parameter
I noticed that you do not use the visual debug ray parameter. This is a shame because it is absolutely brilliant and you can see the exact path you’re aiming at for debugging instead of decrypting FVectors numbers.

This is the method call I use:
bool bHaveAimSolution = UGameplayStatics::SuggestProjectileVelocity(
this,
OUT outLaunchVelocity,
startLocation,
hitLocation,
launchSpeed,
false,
0.f,
0.f,
ESuggestProjVelocityTraceOption::DoNotTrace,
FCollisionResponseParams::DefaultResponseParam,
TArray<AActor*>(),
true
);


Thanks!
Keep up the good work! Excited to power through the rest of these videos.

Side Note: While this isn’t technically a bug, it is a design flaw as it would be much more user friendly if the default was DoNotTrace (considering all the other default settings need to be assigned for TraceFullPath to work well). Maybe someone with the time can push that change to the Github repo as a suggestion to the Unreal developers to merge into the main branch. That would be the best way to get it noticed… and maybe a great topic for another video about how to download the engine source, edit it, and push a suggestion!

8 Likes

This is a detailed and good explanation, thank you. I think now reading forum threads after every video is worth to do!

1 Like

Solved.

1 Like

Privacy & Terms