Switch third person character animation based on button pressed UE4

Well, you need to work in the animation bp, add a condition in AnimGraph that will change it to holding gun and from the Q press change that condition to true. If I could I would drop few animation tutorials for this but UE deleted them for some reason so just look for some on youtube I am sure you will find how to work with AnimGraph from there.