Physics Constraint Actor Destroys Player On Constraint
I have been having issues whereby a Physics Constraint actor will destroy the player when attempting to be constrained by it.
The idea is to have a point in space about which the player can swing - essentially a pitfall swing. I have set up a blueprint that is comprised of two components: a sphere collision (to check for the player's entrance into the swingable area) and the physics constraint component for attaching to the player's pawn.
On attempting to swing, the player's root component - in this case the player capsule since I am using the default SideScrollerCharacter - is set to simulate physics and is set as one of the constrained components of the physics constraint via Set Constrained Components. The other constrained component is the sphere collision in the swingVolume blueprint.
When jumping into the sphere collision from one direction (running right and jumping into the sphere collision from the left) the process works fine. However, when attempting to swing from the opposite direction, the player pawn is immediately destroyed.
I have been able to prevent the destruction of the player by setting linear X and Y movement to Free in the physics constraint component's settings, however this does not accomplish a true rotation around the physics constraint.
I attached a screenshot of the swingableVolume's event graph if that helps to shed any light. I'm guessing that it has something to do with the fact that the physics constraint component is attempting to force the character to face to the right, therefore approaching from the left forces the physics constraint to reset the character's rotation so that it faces to the right. I'm not sure how this results in destroying the actor, but if anyone has any sort of help on this, it's driving me completely insane.
asked Jun 22 '16 at 02:26 AM in Blueprint Scripting
Finally figured this one out but not so much as figured as got a work-around. The issue was assuredly with the player capsule being rotated to face the direction that was "preferred" by the physics constraint. That is, rotation such that the player was facing along the negative Y axis as shown in my previous screenshots. To prevent this, I simply constrained the capsule to the YZ plane using a "set physics constraint" node before attaching to the physics constraint.
I don't know if this is an effective solution in the long run, but for now it has solved the issue. I'll mark this as asolved and hope that this helps others with similar problems in the future.
answered Jun 28 '16 at 09:23 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here