Good afternoon. In my application at me two full-spheres with physics use go downhill. When viewing their path it is visible that the oblique plane absolutely smooth therefore where there would be no initial provision of full-spheres, their paths in fact will be identical. But how to make a certain roughness of a surface to receive a certain different movement? Thanks in advance for the help.
1 Answer
1If you want bumpier rolling than your mesh collider’s resolution, I would suggest you fake it.
While the balls are colliding with the ground and moving, use rigidbody.AddForce (or AddTorque- play around with it to see which looks better) to add a random amount of force to them at random intervals.
I speak about collider. The idea with an accidental force on time is very good, I already thought of it yesterday. Simply I hoped that there is any other method to imitate a surface roughness. Whether there are other methods? Otherwise the cock-a-hoop in a path turns out, but most likely I will use the method offered by you.
– zharik86You could try using Perlin noise based on the world x/z coordinates to control the added force / torque. This would be less jerky and it would give consistent behavior with multiple balls rolling down the same hill.
– KiloblarghPlease, give an example of use of Perlin noise if to you it isn't difficult. I learned it just not absolutely I understand. Thanks in advance.
– zharik86var freq : float; var amp : float; var force : float = (0.5 - Mathf.PerlinNoise (transform.position.xfreq, transform.position.zfreq) ) *2; rigidbody.AddForce (transform.forward * force * amp);
– Kiloblargh
Are you talking about dynamic friction? Or just a mesh collider?
– Kiloblargh