Ball Slowing Too Quickly After Launch

Compared to Ben’s video my ball launches the same but slows very quickly to a slower speed then keeps rolling at the slower speed. I’ve made sure my DragLaunch.cs code matches Ben’s.

My Ball RigidBody settings are:-

Mass 7.3
Drag 0.0
Ang Drag 0.05
Use Gravity On
Is Kinematic Off

My game physics settings (Edit> Project Settings > Physics) has gravity set to 0,-981,0

What could I be missing? Why could my ball have huge initial deceleration which quickly drops as the balls speed drops meaning the ball rolls very slowly. Changing angular drag to 0 seems to have little or no effect.

I’m using Unity 5.5.2f1

Ive found that the unity physics engine isn’t very fond of worlds that deviate too far from the 1 unit = 1 meter rule (although I hear the newer versions are a little better about that). It might be an interesting experiment to divide your entire scene’s scale (and gravity) by 10 or go for full best practices and reset the physics defaults, then and scale your scene by 100 and see if that helps.

Second, all else fails, you can do what we did in the Arkanoid lesson and take the extra step of applying a physics materials to the floor, ball, and pins to have better control. Bowling balls and pins are polished smooth, and the lanes are waxed to a near ice finish. Try friction values of 0.05 - 0.2

I went back in to my game to see what I changed to make my ball work nicely, and I realized I overlooked something important, so I’m replying again for future students.

In your ball script, add in startup

ballRigidbodyName.maxAngularVelocity = number;

Play around with number value, the default is 7.

In unity, like life, a round object can only have so much forward force before the rotation can’t keep up and the object will overcome friction and begin to slide. Similarly, an object can only slide so much before it catches and begins to roll. Unity simulates this by capping the speed at which an object can rotate, which is the above value. It will slide above that number and roll below it. Note that once it begins rolling, angular drag will begin to effect it.

1 Like

Yeah I needed physics materials for the ball and lane to sort this one.

Will also try the angular drag tip you mentioned

This worked for me. I had to set the maxAngularVelocity to 35 to even simulate that effect. But it worked. Thanks.

In unity 2017 when I set the gravity’s Y coordinates to -981 the bowling ball almost comes to a complete stop after hitting the pins. When I set it back to the default value -9.81 it works as expected. Using the rigidbody’s maxAngularVelocity by setting it to a 100 float value improves the bowling ball’s speed but not enough to make it look realistic. I am seeing examples about addforce will have to explore this option. What I am wondering is if the camera’s perspective is giving us the illusion that the ball is moving slower?

Hi there!

The main problem of Bowlmaster section is overscaled gamespace. Ben has giant 38m height pins which weight only 1,53 kg each. His bowling lane has 2km length. So this is the main reason for the strange behavior.

My recommendation for all you guys is rebuilt gamespace using correct scale (1 unit = 1 meter). Use correct objects mass, main gravity etc. In my case, it works perfect and I don’t have any issues with strange gravitation, drag etc. I recommend using some low-friction physic material on the bowling lane too.

:ok_hand:

Patryk,

This makes lots of sense; will try to re-dimension every object.
My only doubt is about the pins… as they are imported Blender objects, their dimensions/scale are 1 x 1 x 1, and I can’t get to know their “real” sizes, and know even less how to change it. Would you please help us on this? :slight_smile:
Thank you in advance,
Daniel

P.S. Since the Top Camera lesson, I realise the pins tremble. I thought it was a fancy Unity behaviour as the ball is rolling… But never made much sense to me as the only link between a rolling ball and the pins would the floor, and my floor have still no physics whatsoever… Now I wonder if the reason they tremble is for being these poor skinny giants…

Correct scale (in Unity) for our pin object is 0.01, which gives us about 38cm height. However, my pins don’t tremble even if I’m using pin model from the course.

So check my prefabs if you want.
Pin model from the course: Bowling Pin Prefab.zip (229.1 KB)
Pin model I’m using in my version of Bowlmaster: Bowling Pin Prefab (new model).zip (201.6 KB)

The only thing you have to do is import package as a custom package and attach your Pin.cs script.

Good luck!

@Rob Meade Can you help to clarify this topic regrading the dimensions of the pins, bowling ball, and the floor? I am using the ratios that Ben has provided and I am not sure if the topics being discussed is the correct way to optimize the pin setter from the odd effects we are seeing with the newer versions of Unity. Especially with the effect of a slower bowling ball rotation.

Not sure if this is the correct way to get the bowling ball to rotate at the same speed as the lane.(or close enough) I added the physic material to the bowling ball and adjusted the friction to .04. I set the maxAngularVelocity to 100f. Being the first time I am developing a 3D game I am out of my element.

In most cases, you should not modify Angular Velocity directly, as this can result in unrealistic behaviour.

https://docs.unity3d.com/ScriptReference/Rigidbody-angularVelocity.html

Anyway, if you have any doubts about issues causing by overscaled gamespace try my test version made especially for you :slight_smile:

In both scenes, I’m using the same parameters. The only difference is objects scale.

https://gamebucket.io/game/fb8a80a8-a42f-49df-a12a-39a517f60539

Key “A” - overscaled scene
Key “D” - correct scale scene

Hi Patryk_S

  1. Your bowling ball is not moving is the WebGL. Nice sound effect.
  2. I am not changing the Angular Velocity. The code is providing a ceiling.

Thank you for the reply.

What do you mean “your bowling ball is not moving”? You have to press left mouse button, drag and then release. “A” and “D” keys to change scenes.

Yes it does work nice after I pressed the ‘D’ Key! “D” did not mean anything to me until you stated ‘keys to change the scenes’.
I am not familiar with the metrics conversion the actual Y and Z would be helpful.

When I change the bowling ball from cm to meters it disappears is there that much of a difference from Ben’s scale? This is not making any sense.

Try setting the gravity (under the Physics panel) to 98.1, instead of 981.

Then try changing the mass of the pins to 153 (instead of 1.53).
And finally change the mass of the ball to 730.

@eovento Of course, you can try some weird tweaks to make it work but this solution is not the right way to go. Unity Physics Engine uses many things to simulate physics like objects mass, main gravity, drag, angular drag, physics materials and much more.

In my opinion, it not makes sense especially that the final effect isn’t as good as with normal scale and physics settings.

@Greg_Sherman Ben’s scale is 1 unit = 1 centimeter, and correct unity scale is 1 unit = 1 meter. So if you want to change Ben’s scale you should divide each value by 100. Nothing will disappear, just the difference is so huge that you have to set the main-camera and game objects positions again.

Anyway, you should not be surprised, if our bowling lane length is 2000 meters instead of 20 meters (2000 centimeters).

So do what you want and play with Unity because using Unity should be fun :slight_smile: it’s only my opinion about doing things in Unity the right way.

Good luck and cheers! :vulcan_salute:

@Patryk_S,
Yep. This is well debated already all through this Forum. But let’s not forget this Bowling section is a learning experiment. Just an exercise for us to practice specific tasks in each video. Of course we can rebuild everything on the right proportion, but at this moment in time, having this already understood, I prefer just to follow along the learning and make it look presentable (to myself only). That’s why I’m going for the quick and simple solution, as what I want is to move on along the course.

Yes, I am aware of the challenges that we are facing and I understand that realistic physics, in this case, is not the most important thing for everyone. But for me, it is (yes I know I’m weird) :wink: and that why I want to share my experiences with you.

I want to move on too and I hope that I will finish my project this week. So good luck everyone and I hope to see you guys in Zombie Runner section soon! :ok_hand:

Privacy & Terms