Announcement

Collapse
No announcement yet.

Rolling ball jumps on flat surface

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • started a topic Rolling ball jumps on flat surface

    Rolling ball jumps on flat surface

    Hello everyone ,

    I'm a beginner with the Unreal Engine 4, so I wanted to create a very simple platform game where the player controls a ball,

    But I have a problem, sometimes the ball jumps even on a flat surface :


    For the collisions I use a box simplified collision :

    Click image for larger version

Name:	1438613438-capture.png
Views:	1
Size:	532.2 KB
ID:	1158767

    And this is how the collision looks like on the map, as we can se there's no "space" between the boxes :

    Click image for larger version

Name:	1438613379-capture2.png
Views:	1
Size:	905.0 KB
ID:	1158769

    Can someone explain to me why the ball is jumping and how I can fix it?

    Thanks for your time!

    (Sorry for my English, I'm French).
    Last edited by MyroG; 08-03-2015, 12:06 PM.

  • replied
    Originally posted by Sly401 View Post

    Sorry I have not yet tried 4.22

    Paul G
    K. That's a pity. I have filed an official bug report. (as seen in the link posted by Alex) Hope it gets solved within the official build.

    Leave a comment:


  • replied
    Thanks Alex, good news at last
    Paul G

    Leave a comment:


  • replied
    Hey all,

    I've put in a new bug for this as: https://issues.unrealengine.com/issue/UE-74451

    Cheers!

    Leave a comment:


  • replied
    Originally posted by ERuts View Post

    Was this succes for 4.22? If so, could you specify? I am trying to fix the issue without compiling from source. If you have a workaround I will be grateful.
    Sorry I have not yet tried 4.22

    Paul G

    Leave a comment:


  • replied
    Originally posted by patrickolden View Post
    Also having this issue, will try the suggested solutions and report back.
    Do you have any luck.

    Leave a comment:


  • replied
    Originally posted by Sly401 View Post
    I had some success with placing a constraint in the BP with the root declared and nothing in the second component (this then seems to default to world.
    all constraints are set as free and I then put an linear motor speed zero on the z axis I set strength to 500
    This effectively dampens the vertical motion.. shame we have to do this tough

    Paul G
    Was this succes for 4.22? If so, could you specify? I am trying to fix the issue without compiling from source. If you have a workaround I will be grateful.

    Leave a comment:


  • replied
    same issu and the contact max offset don't change this problem ! pls help ^^

    Leave a comment:


  • replied
    Originally posted by Biggumzzz View Post
    4.22.0 shows a whole different BodySetup.cpp file now. It looks almost completely rewritten. Thankyou for giving out this vital information to fix this long lasting Physics Issue. I thought I'd never get an answer to this. But still working on it.. Right now I'm completely stuck on what to do and how to fix this for 4.22... I was hoping one of ya'll can help look into that. Hope you guys can get back to me on this ASAP. This is crazy news to see we found some files that we can edit back to 4.19's original state!
    Seems to have been rewritten in preparation for Chaos physics. That line of code can now be found in \Engine\Source\Runtime\Engine\Private\PhysicsEngine\PhysicsGeometryPhysX.cpp. Setting that line back to the 4.19 version in there has worked for me.

    Leave a comment:


  • replied
    I had some success with placing a constraint in the BP with the root declared and nothing in the second component (this then seems to default to world.
    all constraints are set as free and I then put an linear motor speed zero on the z axis I set strength to 500
    This effectively dampens the vertical motion.. shame we have to do this tough

    Paul G

    Leave a comment:


  • replied
    Also having this issue, will try the suggested solutions and report back.

    Leave a comment:


  • replied
    Another fix for this is to enable ContactModification on BodyInstances.
    In the UE4 source, BodyInstance.cpp/BuildBodyFilterData() set bUseContactModification = true;
    (You can make this contingent on a UPROPERTY in PrimitiveComponents to make things more efficient, but the simplest fix is that one line.)
    I presume this assumes that the returned modified normals need to be corrected, even though you haven't actually changed them.
    I haven't dug into the PhysX source yet to see exactly what it does.

    Steve McCrea
    Tech Director
    Armature Studio

    Leave a comment:


  • replied
    I think part of what is causing this problem is actually penetration issue. I am not the most savvy guy, but based on my playing with this issue, I think the engine is "struggling" to come up with a proper way to calculate collision for the angular velocity of the ball. This issue happens considerably more frequently at high speeds and on flat surfaces and slopes using complex collision, with slopes causing even more trouble.

    So my reasoning is that the increase in colliding faces multiple angles increases the odds of this happening.

    Leave a comment:


  • replied
    Originally posted by Fluppi393 View Post
    I can also confirm that the behavior has changed from 4.19 onwards and MaxContactOffset only has a limited impact. Looking at the source code it seems the problem comes from a line in FBodySetupShapeIterator::ForEachShape in BodySetup.cpp. In 4.19 it looked like this:
    Code:
    const float ContactOffset = ComputeContactOffset(Geom);
    And in 4.20 it is this:
    Code:
    const float ContactOffset = FMath::Max(ComputeContactOffset(Geom), RestOffset + 1.f);
    So the contact offset will never be able to go lower than 1 + whatever RestOffset is. I reverted this particular line of code with theone from 4.19 and that seemed to fix the problem.
    and
    Originally posted by bybw View Post
    To fix this issue for the landscape, you will have to apply the same contact offset to the landscape collision shapes in ULandscapeHeightfieldCollisionComponent::OnCreatePhysicsState.

    eg. HeightFieldShapeSync->setContactOffset(MaxContactOffset);

    4.22.0 shows a whole different BodySetup.cpp file now. It looks almost completely rewritten. Thankyou for giving out this vital information to fix this long lasting Physics Issue. I thought I'd never get an answer to this. But still working on it.. Right now I'm completely stuck on what to do and how to fix this for 4.22... I was hoping one of ya'll can help look into that. Hope you guys can get back to me on this ASAP. This is crazy news to see we found some files that we can edit back to 4.19's original state!

    Leave a comment:


  • replied
    Replacing the line as indicated above seems to have fixed this issue when related to joined static meshes however it's still an issue with landscapes.
    To fix this issue for the landscape, you will have to apply the same contact offset to the landscape collision shapes in ULandscapeHeightfieldCollisionComponent::OnCreatePhysicsState.

    eg. HeightFieldShapeSync->setContactOffset(MaxContactOffset);

    Leave a comment:

Working...
X