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.
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.
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
Thanks a lot Everynone, that´s working !
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.
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.
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:
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.