x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Thanks, Nathan

Product Version: UE 4.10
Tags:
helpme.png (474.5 kB)
more ▼

asked Jun 22 '16 at 02:26 AM in Blueprint Scripting

avatar image

Aelelan
6 4 3

avatar image Aelelan Jun 22 '16 at 09:05 PM

So I made some progress on this. It appears that I can get relatively normal swinging movement with other changes to linear Y/Z movement (the X axis points toward the camera in a 2D view).

However, it still seems as though there is an unnecessary amount of force applied to the player when entering the swingVolume from the right when facing left. I can constrain the rotation around the X axis with soft limits (in physics constraint settings) to prevent the unnecessary force from rotating the character the entire 360 degrees. This still results in an unrealistic amount of force being applied to the player so it's still not an complete solution.

I'm unsure as to how I can prevent the player's initial rotation from affecting its interaction with the swingVolume, so if anyone has information on that I would still very much appreciate it.

I'm attaching some more images of the settings I have currently on the physics constraint component as well as how the blueprint appears when placed in the scene.alt text alt text

helpme2.png (256.6 kB)
helpme3.png (1.1 MB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Jun 28 '16 at 09:23 PM

avatar image

Aelelan
6 4 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question