Everything works well, except that the bIgnoreSelf argument which I set to “true” is not working. When the line trace goes through it’s own Static Mesh it detects a hit.
Keep in mind that the same exact code in Blueprint works perfectly. The line trace doesn’t detect a hit when going through the Static Mesh (when Ignore Self is ticked)
But do you know why doesn’t the same code work the same in blueprints and in c++?
I’m still wondering why I have to “add (this)” to actorsToIgnore in the c++ version, and I don’t have to do that in the Blueprint version. Why the IgnoreSelf doesn’t work in c++?
If the WorldContextObject you passed by is the Actor you want to ignore, then it will be added into the Params and then it works as same as blueprint ones.
Sometimes blueprint function will hide this same parameter and pass the self automatically and I think the 'WorldContextObject‘ not just means GetWorld()