I was wondering if anyone here could possibly help me figure out why exactly my collisions arent activating properly on my characters head? He seems to miss the head/jaw and if I get close enough, it will hit the shoulders and pretty much everything else. Im using a physical animation component in combination with a sweepsinglebychannel in my characters tick. When it actually hits, it seems like all the physics and my impulse work fine enough, its just that it doesnt seem to want to make contact with the head for some reason?!?
As you can see from the pictures the position of the “skull” bone and the position of the physics asset cylinder are appropriately positioned, and the hands in my physics asset are set to collide with the head/skull in the physics asset.
In my blueprint you can see my “AttackCollision” is set to block:
Since UE 5.4 we have a new debugging tool called Chaos Visual Debugger.
It allows you to record and see the collision shapes as the physics engine sees them, and it also records all scene queries (line trace / sweep / overlap) done via the UWorld API (which allows you to see them visually, plus the settings used for them).
If you are working on any of these versions I would suggest
Do a CVD (for short) recording to see if the collision geometry is actually present in the physics engine
If it is, see if the scene queries are happening in the place you expect (it should as I see you have added debug draw), with the settings you expect and if any hit was detected.
A small heads up. We found that some of the default setting for CVD in 5.4 are not great, so depending on the composition of your map, you might need to enable some flags to see everything (this is already fixed in 5.5).
Ok so I got a chance to look into this a bit deeper with CVD and I have no idea what is happening exactly, I have two different layers? One that doesnt move at all, and one that shows motion and the physics, but is layered in itself as well? I see 2 monsters walking on top of each other, aside from all that I can see that my characters physics asset seems to go full limp noodle, and is not returning back to rigidity, at least not like my mesh shows me while I’m using my mesh components SetAllBodiesBelowPhysicsBlendWeight(), you can see the difference in the videos:
I have two different layers? One that doesn’t move at all, and one that shows motion and the physics […]
I see one of the Names in the video is Animation editor preview. In 5.4 and 5.5 CVD records any physics world available, and the animation editor creates a world under the hood and that is what you see in the bottom.
You should be able to hide that using the eye icon in the scene outliner or the timeline control track (sadly the name does not say which one corresponds to the animation editor).
I see 2 monsters walking on top of each other […]
This is expected, similar to the above, CVD will record any physics world, that includes the server and client one I see in the second video you have open. Usually this is useful for networking debugging (we added more features for this type of debugging in the UE 5.5 version).
aside from all that I can see that my characters physics asset seems to go full limp noodle, and is not returning back to rigidity, at least not like my mesh shows me while I’m using my mesh components SetAllBodiesBelowPhysicsBlendWeight(), you can see the difference in the videos […]
I think this is the underlying issue. After the first hit to the head, the physics body for it stays down, which explains why every other hit misses it.
You should be able to enable scene query visualization to see if the queries you are doing are indeed outside where the physics body for the head is. This is the specific section
The physical animation component is not my area of expertise, so I cannot advice why it might not be working as you expect from the top of my head.
Hmm. The solution to this still isnt jumping out at me, even with the debugging. Anyone you know that you could CC in on this with more experience with this type of jazz?
So I went ahead and compiled a new source of the latest 5.5.3 version of unreal. The issue seems to still persist, so at least I know now that it isnt a engine version bug at least…
I don’t see it in the screenshots, but maybe you did it later.
Did you add logs to check if the call to disable physics again (which I see you do in the tick) is being called as you expect?
Given that in CVD we saw that the bodies stay simulating, it would be good to know if you call to disable physics in these bones was actually done. Also, I suggest using the colorization mode for particles “State” (you can change that from the show menu).
The color for bodies with simulation disabled should be blue (kinematic) and simulating Yellow. If you call to disable physics is working as expected, I would expect to see the colors for the bones turn blue (kinematic). If they stay yellow, it means they are still simulating.
I ended up finding decent solution for this tonight. I ended up figuring out that even though the physics asset is working visually with its interpolation, its back end physics asset representation wont interpolate back pretty much with whatever I try(Until I turn the simulate physics off), but that being said, I decided to try another approach and decided to add a test collision sphere attached to the socket of the Skull bone, turns out, that the collision sphere stays in place with the skeletal meshs’ current bone position from the PIE represented skeletal mesh, and I can even see it in the CVD (Thanks for making me aware of this again by the way). So where the collision sphere I attached to my skull bone is properly following the interpolation, I was able to use it to determine my collision, and then using the name of the components attached socket (which is my bone), I was able to add the impulse to the physics asset in the correct spot. The results of which I think look decent enough as a starting point until I tweak the physics assets constraints a bit more. This probably isn’t the most ideal solution for this problem though, but this is something that started working better for me than any other approach I’ve taken thus far, plus it allowed me to utilize the physical animation component still in the way I wanted in a multiplayer replicated way.
In this video, you can see the light blue colored representing the new collision detection bone, but you can see it doesnt follow the yellow physics asset, its still following the mesh from the PIE side of the interpolation, so using this method, I was able to actually continue hitting the mesh in the right place, and continue to hit the mesh with physical impulses: