Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Soft body for L shape?

Discussion in 'Scripting' started by ducloc96, Aug 31, 2021.

  1. ducloc96

    ducloc96

    Joined:
    Mar 18, 2018
    Posts:
    26
    I am creating a soft body according to the following video tutorial:


    But when I convert to L shape, it doesn't achieve the desired result because I don't know how to find the center of L shape?
    Thanks for reading.
     
  2. ducloc96

    ducloc96

    Joined:
    Mar 18, 2018
    Posts:
    26
    Video tutorial to create softbody for circle shape. They use 1 point in the center of the circle and 5 points around using 2d spring joint to connect together. They then used sprite shapes to create a circle shape based on the points I mentioned above. I'm wondering how can I create L shape from sprite shape controller whose points have spring joint 2d together?
     
  3. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,590
    A circle has a single center point. An L does not.

    So the first thing you need to experiment around with is having several center points.. or even a center object / shape which cannot be deformed. Around this / these you can then attach your wiggle bits and pieces to achieve the wanted effect. How exactly you do this is up to experimentation.

    Or you look for a tutorial more closely matching your usecase, even if some circumstances are different, ie it being about 3D objects. You then need to transfer the learned knowledge to your own usecase and apply it.
     
  4. ducloc96

    ducloc96

    Joined:
    Mar 18, 2018
    Posts:
    26
    I have the above points connected together by spring joint 2d. Is there any way to create L shape from the other points?
     

    Attached Files: