I have a simple Pawn character that I added a physics capsule/body rig to to figure out how to set up my main character.
Now it seems this physics asset does not recieve the impulses that I am sending to it. The setup works fine on my first even simpler ‘just a cube target’ setup.
The hits do trigger as I have a shader/material that switches color on hit.
One thing I am suspicious about is that when I print out the Hit’s ‘Other Comp’ I get:
LogBlueprintUserMessages: [IkRig_BP_C_50] sparring_rig_BP_C_0.SkeletalMesh sparring_physics_rig_MeshOnly_1
‘IkRig’ being the one that delivers the hit.
Shouldn’t it say something about the Physics Asset (which I named with that extension) ?
I do have Generate Hit on in my phys rig bodies/capsules, and as I said the Hit triggers but the Impulse that is linked in does not seem to deliver any force to the physics rig.
Would anyone have an inkling what I might have missed?
EDIT: I just noticed this Warning message which is weird because I definitely have that set to ON already. I also set it to on again on BeginPlay.
“PIE:Warning: Warning sparring_rig_BP_C_0.SkeletalMesh sparring_physics_rig_MeshOnly_1 has to have ‘Simulate Physics’ enabled if you’d like to AddImpulseAtLocation.”
Why do I get this when it is already on? I also pause the game midplay to inspect that setting and it was indeed on so it shouldn’t complain.
Ok so I have got something working now. Although I’m not so sure its the best solution.
I find it confusing that the whole physics rig is not represented as a regular component and I am not sure where in the docs I can read about its relationship with the skeletonMesh itself?
Here is what I did,
1. I figured out I had to ‘activate’ all the physics bodies. I did it like this
2. I realized that I missed giving the needed ‘bone’ parameter to the add Impulse. But the problem was also that in the BP of the character Delivering the hit, the 'Break Hit’s ‘Hit Bone Name’ did not give me anything. It just gave ‘None’. So that wouldn’t work. (I’m pretty sure the Hit was happening fine)
So I moved the Hit registration to the receiving character blueprint and when I did a OnComponentHit there with a break hit and printed the Hit Bone Name it worked as expected.
3. I am also starting to figure out some confusing differences between the skeletal mesh itself and the phys body rig, like that I can have ‘Generate Hit’ to OFF on the mesh itself, as long as I have it on the bodies. (will the bodies still obey the hit/overlap rules of the main mesh?)
But I now have other questions which I will probably write as a separate post. For example if there are BP nodes that can set Physics Blend Weight on single bones rather than ''all below x".
**Is this expected behaviour or a Bug? That I didn’t get the Bone Names in the hitters blueprint? (or still something I missed?)
EDIT: managed to get the bone names by using a onComponentHit instead of the straight OnHit event I first used. Still the Impulse does not seem to work in this BP so Im using the targets.
It seemed more intuitive to do the Impulse add from the hitters BP as I had overlap boxes that I combined with the hit box to switch and change certain things around.
Is there a more right way to do this? Having the Hit management in the Delivering BP or the Receiving BP?**