About 'Prevent Boring Ball Loops'!

In this video (objectives)…

  1. What's our problem? Boring ball loops.
  2. How can we solve it? Adding velocity tweaks to our balls when they bounce into things.

After watching (learning outcomes)… Add velocity tweaks to our balls to stop them being boring.

(Unique Video Reference: 33_BR_CUD)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!

Hi there,
First time posting here. I am learning so much from your lectures, so thanks! - I wanted to say that I never have the problem of the ball just going horizontal and it is because I never changed the gravity in project settings to zero.
Cheers!

  • JB

Thanks for the post!

Hi, my ball slows down over time. I have the randomFactor set between 0.2 and 0.85. I’ve also tried keeping gravity at -9.81, and have tried other numbers. And occasionally the ball hits the paddle and just totally slows to almost zero velocity.

I think its a good lecture but this is probably not the complete solution for boring ball loop problems. After completing the lecture all users experience the same problem which is the ball slowing down. I believe the solution to that is to add some if statements to our velocityTweak codes so that if our ball has a negative x or y velocity the x or y tweak should also be negative and if our ball has a positive x or y velocity the x or y tweak should be positive.

1 Like

So I found this very interesting. I had no idea it was actually going to come to trying to solve this problem in the lecture, so when it first arose I tried to solve it, and did, on my own. My idea was to check the x position and y position every frame, and if they have no changed start a timer, run the timer until it either does change or the timer hits 5 seconds, and if it didn’t change within the 5 seconds to nudge it very slightly on the axis it wasn’t moving on. I don’t have any slow downs or anything like anyone is mentioning, and the ball bounces off surfaces exactly as you would expect instead of randomly. I feel this is the ideal solution. If anyone would like the code I can gladly post it, It works perfectly.

1 Like

Privacy & Terms