Collision slows ball motion, but I dont know why

Override the modes. Min for Friction and Max for Restitution. See if that behaves as expected. With modes overridden, you then need the phys material on the ball only.

Hello,

Absolute beginner here. I try to make a Pong like game, just for learning the UE and Blueprints.
What I dont get is why my Pong ball is slowing down only when it hits the AI paddle.

I gave bouncy materials with friction 0 and restitution 1 to every mesh/actor. If the Ball is hitting the player paddle or top/bottom wall, the bounce speed is the same as the hit speed, exactly how I wanted it to be (f.e. x-500 on hitting the PlayerPaddle and x500 as bounce away speed). But if it hits the AiPaddle on the right side, then the bounce speed is always slower than the hitspeed.

The Paddle mesh in Aipaddle actor is copied from the Playerpaddle and I already used hours to check if every option is the same. Also there is no blueprint code touching any physics at the moment, beside the initial addimpuls. Gravity in Project settings is 0.

Project Upload: https://easyupload.io/yfl000

I just tried that and it still doesn´t work unfortunately, although that trick is handy to know for the future. I just uploaded my project (600mb) : https://easyupload.io/yfl000

This is caused by the AI Test’s Tick calling Move Component To every frame. You’ll need a better way to move the paddle.

As in to why it’d affect physics in this peculiar way, I’ve got no clue. Would need to have a look at what this node does under the hood.

This could work:

Image from Gyazo

Also, the paddles do not need physics here (unless you’re planning something special for them).

Thanks a lot Everynone, that´s working ! :slight_smile:
Btw F-Add-Force is also affecting the physics like move-component-to, I wonder why.

I put the physic on, on the paddles because I thought I can use less code then to stop both paddles at the edges, where the walls are, as they bock each other automatically then.

regarding MoveTo:

Because it’s a latent action, It’s supposed to work over time and calling it every frame just floods the system.

If you’re asking it to move 100 uus over 1s but ask for it 60 times in a single second, it may seem to move OK - but it’s really restarting the initial step of the movement 60 times rather completing the intended move once, over a period of time.

This will be very noticeable if you flag Ease In / Out - these now interpolated steps are much shorter, and since only the first one is ever executed, the movement will be sluggish.

This kind of movement is best used when you want to click somewhere and have an actor travel there on their own, rather than apply movement constantly - adding force.

As in to why this system loses energy when interacting with moving elements only, I have no clue.


edit:

  • disabled CCD on all components (counter-intuitive, I know)
  • upped the Velocity Solver Iteration Count from 1 to 2
  • removed collision from the ball, and added a new sphere collision

It all behaves somewhat reasonable now, still far from perfect, though.


:expressionless: Fortunately, UE4 is moving away from its current physics system soon…

You could include a small snippet in the ball that keeps the velocity in check, something along the lines of:

Link to the project with all the above-mentioned changes:


And that’s enough Pong for me for one day.

I put the physic on, on the paddles
because I thought I can use less code
then to stop both paddles at the
edges, where the walls are, as they
bock each other automatically then.

Physics would make sense you wanted the Paddles to be simulated - bounce off the edges if the user overextends the movement, or have the ball affect the paddle somewhat realistically. It would definitely add a layer of awesomeness to the rather bland pong gameplay, for sure.

If the goal is to move the paddles and have them respect boundaries defined by level geometry, a Floating Pawn Movement component is a better choice imho:

  • input:

  • the player paddle - notice the Movement Component, it will utilise the collision at the root of the owning actor as it’s asked to move it

  • the ball

The Floating Pawn Movement is specifically designed to cater for that kind of movement and even comes with some basic properties you can tweak. Consider it and see whether the whole things behaves closer to what you’ve envisioned.

While there are many ways to approach all of it, this would be my initial go to methoed.

Thanks a lot, this is extreme helpful ! :=)