Attached Weapon Collision?

My Problem is this:
I need to have collision for my sword, which is attached to a socket on a normal, skeletal mesh.
(And yes, I already made a working physics asset for the character)

The mesh also has a physical animation applied to it, which is also needed.

GIF of what I mean:
https://puu.sh/zB9jo/5b1109c6a8.mp4

But as you can see, it looks glitchy when the sword is colliding with the mesh, which is very undesirable.

Any help is appreciated, thanks.

1 Like

If it is a collision issue between the sword and the character’s mesh then perhaps set the actors to ignore each other with “IgnoreActorWhenMoving(AActor*, bool)”?

1 Like

But the thing is, I need to have a collision between the sword and the character.
It should just look smooth, instead of glitchy.

Hello!

If you really need collision between sword and owner character mesh, well… no one click solution exist.
Because animation is physics and bone driven and this will not check your attached weapon collisions properly will cause glitches…
I think thats some engine thing, because physical animation run on skeletal mesh after that world uptadets your weapon mesh collision…

I got some idea to make this better.

  1. you can try to make a bone from hand named “Weapon Bone” in your mesh (or even a virtual bone). Then using this bone maybe you can setup collision in physics asset. Weapon collision must be turned off and let physical animation controll bones… Whenever you need check collision or something you should check “weapon bone”
  2. Second idea is similar actually: if this is a gameplay mechanism (like character should damage itself) maybe better idea to use Overlap detection. If Weapon overlap with your character you can do things.
  3. you can write your own controll using overlaps… if weapon overlap the mesh you can add force or set his location or whatever, just move toward from the mesh itself.
  4. you can do manual shape trace tests and disable weapon collision :slight_smile:

Collision and physics driven things always can be glithcy… Maybe you can finetune with more iteration in simulation or fixed timesteps, but we can 100% trully trust in physics since he can miss and really depends on framerate…

I suggest to try without collision then your weapon will not cause glitch but with overlap events you will not lose possibility to check whenever hit the character mesh. :slight_smile:

Thank you very much for your reply.
I solved it now by fiddling around with the physical animation settings and most importantly, make it, so that the character won’t turn instantly, but with at a reasonable rate. (Was deactivated before by mistake)

If I have any further complications or so, I will try your methods.

Solved it temporarily. (?)
Just make sure that the rotation rate (turn rate) is low and reasonable, so that the character won’t turn instantly.

https://i.imgur.com/SzEe7NN.png

Next would be to fiddling around a bit with the physical animation settings (make sure the strength settings are not too high, otherwise they will look glitchy as well.)