Download

Preventing player weapon from clipping through wall with overlap events is causing jittery animation

I am trying to get my player’s weapon to avoid clipping through walls, so I added a collision box around the weapon and scripted a basic overlap event in the weapon’s BP. It plays a montage animation on beginning overlap, and stops playing it when overlap ends.

f7f01bad7270972dfd96512d6a8dc0d1bcd1d06e.png

It works well enough, but when the player looks at certain angles, their weapon begins to jitter and vibrate as though the animation is activating and deactivating over and over in rapid succession. Like, the animation itself is causing it to stop overlapping, then overlap again etc.

Is there any way for me to avoid this? Should I use something other than a collision mesh with an overlap event?

Googling, I saw some people talking about using a line trace, but I’m honestly not sure how to go about setting it up in this situation.

Any help would be greatly appreciated.

Never mind guys, clearly I was tired as heck last night and didn’t find the line tracing documentation page which gave me all the info I needed.

I dunno if the way I did this is the best method, but it seems to work for me, so here’s the BP if anyone else needs it.

d769193146335575af580a867a2d377a1fd2da34.png

I think for stuff like this is IK