Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fluppy/Bouncy Ring
#3
Hi,

I made you an example of this. You can find it attached (it's a zipped UnityPackage).

As you will see, it's very simple: a surface shader that deforms the mesh in the Y direction, and a C# script (BounceController.cs) that drives the amount of deformation using a spring. That's it.

You can call the bounce controller's AddImpulse() method whenever the ball touches the ring, and you're done. You could even pass a larger or smaller impulse depending on the contact velocity.

This is how it looks like (an impulse is added every time I press the spacebar, making the ring "bounce"). Different values for the spring and the dampening coefficient give different results:



cheers,


Attached Files
.zip   BouncyRing.zip (Size: 97.24 KB / Downloads: 0)
Reply


Messages In This Thread
Fluppy/Bouncy Ring - by mgnito - 19-03-2021, 10:19 AM
RE: Fluppy/Bouncy Ring - by josemendez - 19-03-2021, 10:50 AM
RE: Fluppy/Bouncy Ring - by josemendez - 19-03-2021, 01:35 PM