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

I'm working on a project and planning to use Obi softbody but I'm not sure if I can achieve the ref below.

It's like a Ring mesh but probably composed of multiple meshes maybe about 8 arcs, but behave like a single one,

Please see vid below
https://imgur.com/a/DmLnZOm
Reply
#2
(19-03-2021, 10:19 AM)mgnito Wrote: Hi,

I'm working on a project and planning to use Obi softbody but I'm not sure if I can achieve the ref below.

It's like a Ring mesh but probably composed of multiple meshes maybe about 8 arcs, but behave like a single one,

Please see vid below
https://imgur.com/a/DmLnZOm

Hi there!

I’d bet my right hand that there’s no actual softbody physics going on in the video. Really looks like just a procedural displacement in the vertex shader, done in world space.

Makes sense to do it this way, since this is a mobile game, so the cheaper your approach the better. Collisions need to be very reliably detected, so you need a continuous surface (discrete, particle-based approaches like Obi are best avoided in this case).

My advice: do this in a vertex shader. Simple, fast, and free. Let me know if you need help with it, I can whip up an example.
Reply
#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