So I’m trying to get a third person character to shoot at the cursor’s location whenever it is locked onto an enemy.
I’m using Get Hit Result Under Cursor and the node works as intended when the result is a blocking hit.
However, if it does not hit anything (which is what happens whenever the cursor is over the sky), then the location vector is equal to 0,0,0 and the bullet won’t shoot at the right location.
So what I thought about doing was using Trace End instead of Hit Location, but if there is no hit, Trace End is also equal to 0,0,0.
I don’t really know whether this is a bug or not but it seems weird that Trace End is at 0,0,0.
It’s also worth noting that I did change the trace response in the Sky Sphere mesh in BP_Sky_Sphere to block the trace but it still returns false when I check if there was a Blocking Hit.
In any case I was wondering if there is a workaround for that beside add extra volumes to block the traces.
Seems to work for me. Deproject Mouse Position to World will return a proper vector even without a collision trace under the cursor. One thing to watch out for is that the length of the returned vector is inconsistent.