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"

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

Product Version: UE 4.13
Tags:
more ▼

asked Nov 08 '16 at 05:59 PM in Blueprint Scripting

avatar image

douglasdriving
26 1 5 6

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Nov 08 '16 at 07:42 PM

avatar image

SHOBBIT
650 12 13 27

avatar image douglasdriving Nov 09 '16 at 06:58 PM

seems like changing the mass of the ball didnt make any difference on the bounce. it feels like if the platform makes a great force on the ball pushing it in an upwards direction so that it moves even faster than the platform. Gonna need some help here.

alt text

namnlös.png (716.9 kB)
avatar image SHOBBIT Nov 09 '16 at 07:01 PM

I will try to recreate this and reach back to you till tommorow. Cheers.

avatar image douglasdriving Nov 09 '16 at 07:22 PM

Thanks very kind, thanks alot :)

(comments are locked)
10|2000 characters needed characters left

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.

alt text

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 -

  1. Follow this tutorial to override the world default gravity - (Set it to a very high value like -1000). THIS WILL EFFECT every single physics object in the world.

https://www.youtube.com/watch?v=EZ9klcc6HLk

  1. You will notice now the ball cannot jump, as the gravity is too high, so you will need to go into your blueprint and adjust the "Roll torque" and "Jump impulse"

  2. Now mass comes into the picture as when you now collide with other physics object, not much force will be applied to them. So to correct it you need to increase the mass of the ball.

So summarizing my 15 minutes of experimenting,

Two possible solutions -

  1. Either don't make the elevator do a sudden movement.

  2. Follow the above three points.

You will see it all comes down to level design in a physics based game. You need to think a little like a physicist.

sol.png (95.5 kB)
more ▼

answered Nov 09 '16 at 08:16 PM

avatar image

SHOBBIT
650 12 13 27

avatar image douglasdriving Nov 10 '16 at 07:11 PM

Thanks! this made it better. Too bad it didnt solve it completely, you still get a tiny bounce.

(comments are locked)
10|2000 characters needed characters left
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