How do I create bouncy ball object like rubber?

I’d like to create bouncy ball object which make change.
I think that I must use mesh renderer.
But, I don’t know how to this.

I guess I may use like that.

    var mesh : Mesh = GetComponent(MeshFilter).mesh;
    var vertices : Vector3[] = mesh.vertices;
    var normals : Vector3[] = mesh.normals;

    hoge bar;

Attach a rigid body to a sphere and apply the “Bouncy” physics material from the standard assets?

Couldn’t have said it better. And take a look at this.

Edit: If it’s mesh deformation you are talking about, not sure how to do it but you can check out Mega-fiers

Re-reading it im beginning to suspect he wants a soft body effect so the ball deforms when it hits the ground…

Thank you for replying

Re:Headingwest

Attach a rigid body to a sphere and apply the “Bouncy” physics material from the standard assets?
thanks. but, It is not I wanted to say. I wanna make to “change shape” the ball.

a soft body
Yes, I want to say. I couldn’t explain in English well…

Re:zine92

Mega-fiers
It is my image. but, It is not free.
Can you show me a JavaScript code?

And, I want to use it in both iOS and Android.

Actually scripts you write can be compiled to both provided you have the licenses for both. But as to how to do mesh deformation. I am not too sure about it. Can’t help you much.

If all you want is a stretch/squash, then you could just scale the mesh along a specific axis.

void OnCollisionEnter(Collider other)  {
   
   float XScale = transform.localScale.X;
   float YScale = transform.localScale.Y;
   float ZScale = transform.localScale.Z;

   YScale = Mathf.MoveTowards(YScale, 0.6f, 0.03f);

   transform.localScale = new Vector3(XScale, YScale, ZScale);

}

You’d need to do a lot of modifications to that script to make it work, especially if you’re doing your project in JS, but it shows the general idea.

Hope that helps!

This is a pretty decent thing to look at for different effects

http://unity3d.com/support/resources/example-projects/procedural-examples.html

HI
do you mean “Crumple mesh modifier”?

Added a rubber material modifier to MegaFiers might be what you are looking for.

Maybe what you seek is something like this:
http://forum.unity3d.com/threads/103858-Soft-Elastic-Material

Apologies for bumping such an old thread, but this thread still comes up when googling this question but there’s no real answer or solution here.
I looked around for a while and found this FREE asset on the unity web store that lets you create softbody physics: Unity Asset Store - The Best Assets for Game Making (it’s called Bullet Physics For Unity)

1 Like

That’s really amazing man, thanks a lot !!

Because this comes up in searches for example Physics Materials, here are the original Bouncy, Ice, MaxFriction, Metal, Rubber, Wood, and ZeroFriction from Unity:

http://exninja.com/files/PhysicsMaterials_From_Standard_Assets.unitypackage

3409403–268493–PhysicsMaterials_From_Standard_Assets.unitypackage (1.42 KB)