- Home /
what is the reason for 'supposed' frictional force, when physics material of ground is configured frictionless.
i have a moving ai, the box. it moves using forces. horizontal(in x-z plane) motion is due to inputs, and only vertical (in y axis) force is gravity.
other than that i have applied a custom quadratic drag, only in horizontal plane. the forces are supposed to balance each other so that max speed achieved by character is maxSpeed. but, it yields less speed, usually 4-5 m/s less.
one contributing factor to this was friction of the horizontal plane gameobject. i applied a physics material configured with 0 friction. still max velocity achieved is less than maxSpeed.
is it due to physics engine iteration? like, gravity pushes the box little inside the plane? or there is some kind of force i am missing.
the forces are supposed to balance each other so that max speed achieved by character is maxSpeed
How did you "balance" them? You know that having a quadratic drag is not a hard limit you will reach after x seconds. You will asymptoticly approach that max speed but mathematically you will never reach it. Also keep in $$anonymous$$d that the physics simulation happens in discrete steps.
If you want the user to be able to reach max speed after a certain amount of time you have to allow a slight overshoot and then just limit the velocity in the x-z-plane to max speed manually.
Finally keep in $$anonymous$$d that friction is not only based on the friction value but also depends on the "combine" values. $$anonymous$$ake sure you read the details section carefully. If two objects interact there are always two physics materials involved. So it depends on both settings. In your case you probably want to set the friction to 0 and frictioncombine to either $$anonymous$$imum or multiply. This of course has no effect if the other material uses maximum with a non zero friction value. There's a clear priority order of the combine values.
Is that zero-friction material on both objects? What about the "Friction combine" setting on the box? In order for it to experience zero friction you'd either need zero friction on both objects or zero on the box, together with its FrictionCombine set to $$anonymous$$imum or multiply (and the floor's NOT set to maximum as that would override).
Also worth mentioning that the friction model isn't perfect. See the "Please note..." para in the docs: https://docs.unity3d.com/$$anonymous$$anual/class-Physic$$anonymous$$aterial.html
Zero ought still to be zero, $$anonymous$$d.
Your answer
Follow this Question
Related Questions
Solar System Simulator Orbits Not Working 2 Answers
How can I add a reaction force? 0 Answers
take control over particles 0 Answers
buttonNames for GetButton 1 Answer
How to make rigidbody move with another rigidbody respecting physics? 1 Answer