How do I stop a ball from bouncing?
Hi! I am working on a simple platformer where I have added an elevator, or more specificly a platform that is moving up and down. The problem is that if the player pawn, a simple ball, is on the platform when it starts moving upwards the ball starts to bounce up and down higher and higher. I have tried to lower the retuition of both the ball and the platform to zero but it still bounces a little. What i want it to do is go upwards with the same speed as the plarform. What should I do to solve this? Thanks
asked Nov 08 '16 at 05:59 PM in Blueprint Scripting
Kinda of unclear until I get some screenshots but, some things that might not be suitable but tryable are while assuming you have physics enabled are increasing the mass of the ball. Which should be the solution inside character movement component.
Another thing which should not be a final solution but depends on your view is to add a box collision on the elevator so that when the player enters it his gravity scale increases and when he exits the scale returns back to normal.
Alright, I decided to do it right now so that I don't forget.
What I did was use the rolling ball temple (assuming you did the same).
The problem is the ball itself and physics, now in a normal character actor we get the "character movement" component which helps in adjusting a lot of things like gravity, velocity and what not.
In this we don't, it simply has a mesh which has physics enabled and some controls that are driven by variables.
So, manipulation of mass does not help us,
Now, in the default scenario, I created an elevator that moves with the help of a timeline (Assuming you would have also done the same thing). Here is the code.
When the timeline is set to its default of 5 seconds, everything works fine-ish, it is just that the elevator moves slowly. The problem is when you make the elevator do a sudden movement. Because no matter what the elevator will move and the ball will follow physics.
So, the solution that I found was, to off-course make the ball stick to the ground, which is done by the almighty GRAVITY. But as we have no character movement component, we cannot change the gravity inside the BP (AS FAR AS I KNOW, WHICH IS NOT THAT MUCH).
What you need to do to try this out if you like is -
So summarizing my 15 minutes of experimenting,
Two possible solutions -
You will see it all comes down to level design in a physics based game. You need to think a little like a physicist.
A simpler way to do it would be add an invisible, one way roof. That way the ball can drop on the platform if needed but cannot bounce
answered Jul 16 '19 at 11:11 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here