Third Person Camera Pitch Messing with Line Trace

Hello everyone! I’m new to unreal and I’m practicing with a third person shooter. I have a basic line trace blueprint using the camera location as well as the socket location for the weapon.

It works great until I aim up. I don’t know if it’s the camera pitch that’s messing with the calculations, but once I do the line trace shoots backwards. (Will add ref in comments)

I looked for solutions in youtube, google, and browsed a couple of topics here but I can’t seem to find any information in this specific issue. Does anyone has any suggestions on how to address this or what might be causing it?

I appreciate any help. Anything I can do to improve.

Line Trace reference:

LineTrace

Line trace shoots backwards and hits wall whenever I aim up.

Wait, I just understood what’s happening. The line trace doesn’t hit something when it goes to the sky, so it automatically goes to world position 000. Use a branch before going to ask the barrel to shot a line trace to check if you are hitting something with the boolean return value.

Thanks for the suggestion. I branched before tracing with the barrel and it’s no longer creating a trace line either direction.

Branch-Trace

Added a print string on false and it prints false whenever I aim up while shooting. Is it hitting the capsule? It shouldn’t since I have the trace projectile collision on ignore.

The problem here is that: The line trace, let’s say, final, expects a response from where it came from. You should just tell the line trace to fire regardless of waiting, ie, you can shoot the sky! :slight_smile:

Simple code: Simple hit posted by anonymous | blueprintUE | PasteBin For Unreal Engine

Hope it helps! :v: :slight_smile:

Thank you! That seemed to do the trick. I really appreciate your help!

1 Like

You’re welcome, my friend. :pray: :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.