Fluppy/Bouncy Ring - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html) +--- Thread: Fluppy/Bouncy Ring (/thread-2814.html) |
Fluppy/Bouncy Ring - mgnito - 19-03-2021 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 RE: Fluppy/Bouncy Ring - josemendez - 19-03-2021 (19-03-2021, 10:19 AM)mgnito Wrote: Hi, 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. RE: Fluppy/Bouncy Ring - josemendez - 19-03-2021 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, |