Okay so I was following an Aim Down Sight tutorial for my shooter project. While I was working, UE5 decided to crash and when I restarted the project, somehow my Animation Blueprint broke (I was playing with it when the crash happened and probably it was something I did that led to the crash).
Then upon restarting, I started having this issue where, idle and walking are fine but sprinting gives me a weird behavior. I deleted the AnimBP (thinking it got corrupted or something) and re-made it, but the issue still persists. Nothing has been changed. All the animations and blendspaces are just the way they were.
Jumping while sprinting, throws the player backwards as if something is pushing the player. And sprinting, as you can see, is hitching (like it’s looping but breaking suddenly).
I narrowed it down to something related to collision on my gun model. I have tested it in many ways. But idk how to disable collision.
Like even after disabling collision in so many ways, the problem still persists.
It is definitely a collision issue. Be sure to set the collision of your weapon mesh to NoCollision:
Well I forgot to mention, but there is no collision setup anywhere. Weapon has no collision. Blueprint’s mesh has no collision. Everything everywhere I could see, I turned everything to NO_COLLISION but still it persist.
The sad thing is, when I disconnect the node that attaches the weapon to the player, this issue disappears. And it’s independent of weapon mesh. I used a free weapon from marketplace (that was game ready etc) and I faced the same issue.
What can it be?
Hmm. Interesting. Well if the issue disappears when you disconnect the attaching node, you can attach it manually from the character blueprint itself instead like so:
To make it better, you can open the character skeletal mesh and add a socket to hand_r or hand_l or wherever you want:
Then by right clicking the socket, you can add preview mesh and adjust the positioning accordingly:
That is how I’m doing weapons in my current project. I am not using any projectiles except for rocket launcher/grenades but a simple line trace for handling collision/damaging. Works like this, if you like how it looks I can help setup something similar: