I tried to make a setup to understand how physics materials work. but im kinda stuck on this topic.
i found this link that tries to explain it: Exactly how does friction direction 2 work? - Unity Answers
though i am unable to reproduce what is being said there.
so in a bit more detailed steps i did:
- Create a cube.
- Create a plane.
- Add a rigid body to the cube.
- Add a script to the cube that calls WakeUp() on its attached rigid body every frame.
- Create a physics material
- Set dynamic and static friction of this material to 0.1
- Set dynamic2 and static2 friction of this material to 0.8
- Set friction direction 2 to (0,0,1).
- Add this physics material to the collider of the cube
now make sure the cube is positioned on top of the plane, and that gravity is applied to it (the checkbox on the rigidbody)
this is my current setup.
i press play, and rotate the plane (so the cube will slide due to gravity).
if i read that link correctly, there should be a large difference in how it slides towards the z axis compared to the other directions.
there is however not any noticeable difference in friction towards any direction.
can anyone provide me with a setup that gives me the expected outcome? or explain to me what i did wrong.
as a sidequestion, i plan on using this to model a car (hence, i need 2 directions (left/right) to have different friction values from forward and backwards)
but the material only allows me to specify 1 direction.
does it math.abs the dot product of velocity/direction? (thus taking both the positive and negative axis of the specified vector. or do i need to apply some other magic to change both directions?
(tested in unity 5.0.1f1 (personal edition))