- Home /
strange unrealisticly physic problems about velocity/gravity acceleration
Hi guys,
I'm working with a physics ball game,but I meet some velocity/acceleration problems, In these 3 days I have googled a lot of articles with many keywords,but I am still very very confused with these problems,and totally have no idea to deal with it.
My game is a ball with rigidbody , when arrow keys are pressed, I will add a force on the ball using "AddForce" to make it move,here are my questions:
why the velocity of ball has a max value, when I use "Debug.Log" to print the "velocity.magnitude", I always saw a max value such as "10.459123"(the max value depends on the mass,drag etc)
when I put the ball on a 15(can be others,but not to big) degrees slop, let it roll down with no other external force except gravity, what I expect is the ball will roll down the slop more an more fast,but it's not, the velocity reach a max value in a short time, It seems like there is no gravity acceleration, the ball roll down the slop in constant velocity .But If I change the degrees of slop to a big value such as 45 degrees, then the velocity is increasing...
the rotation of ball seems NOT relavtive with the velocity, when the ball move very fast, it should rotate fast too,but It's not, it rotate very slow,why ?!
I have tried to scale the world, change the mass,drag etc , or add a physics meterial, change the frictions.......... but the problems are still not solved.
Is there anyone know something about these problem? Is there some articles useful? or If It is a limit of the unity/phyxs? How do you solved problems like that in your game? Should I write the phyxs part myself to make it more realistic? I thought that when I set the varibles like mass,drag,friction etc, unity will do the physics part, am I wrong? you guys just write your own physics code to make you game more realistic?
I was stuck here for 3 days..... Please help me :(
I am not good at english, if it's not clear and you what more infomations about the problems ,please tell me.
pictures about the problems:
@Bunny83 , @Halfbiscuit , @Dave Carlile
thanks guys, after these days of search&reading, although the problems are not solved yet,but I am glad to be more clear about some concept like drag/velocity in Unity3d, I think I should write my own code to controll the behavior of my game ball, when finished I will put some codes here.
I am apprecaite for Unity3d's official video tutorials to give me a good start,but I am very frustrated now about why the unity3d guys can not explain more about these drag/velocity/friction questions for so many years, I found that a huge amount of developers are confused about these things, and so many posts about it , why the unity3d gus can not give more helpful details in api/manual documents..
Its like learning to ride a motorbike. There are some things you just need to get a feel for ;)
Answer by Halfbiscuit · Oct 14, 2015 at 12:39 PM
My guess is the friction value is slowing the ball down so much that it reaches maximum velocity quite quickly. At 45 degrees it would reach a maximum if you left it for long enough.
Have you ever used Physic Materials? These will allow you to customize the friction value(s) on the sphere.
Halfbiscuit,thanks for you reply. Yes ,I tried to add physic materials to the ball and the ground etc, and tried to use a lot of diffrent friction values.....but It still does not work correctlly,
I'm really not sure then, adding physic materials to both and setting the friction values to zero should cause the velocity to continually accelerate as any angle.
Answer by Bunny83 · Oct 14, 2015 at 02:14 PM
Unity uses a strange linear drag model that is only dependent on the drag value and the used timestep for physics. See my post over here. Your drag value essentially gives you a max velocity. Also see this post where i have some methods to calculate the max velocity based on the given acceleration / drag combination.
If you don't want to be bounded like this, you should set the drag to 0 and apply your own drag. However keep in mind even in real life when just considering air friction each object has it's terminal velocity.
Also keep in $$anonymous$$d that if you have friction between the floor and the ball, the angular drag also plays it's part. As it inhibits the balls rotation due to friction with the ground it would also reduce the linear velocity. As i mentioned in my other posts, the calculations i made completely ignore friction of any kind. That's almost impossible to "predict" / calculate correctly as it depends on internal physics collision events and their force values.
Bunny83, very appreciate for your informative links and kind re$$anonymous$$der