Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Soft Body not colliding 2D mesh
#2
(28-12-2020, 09:47 AM)beatrichartz Wrote: Currently what it does for me on Unity 2020.2.1f1 is the following:
- With normal unity RigidBody 2D and colliders, everything works smoothly
- When I add in the Obi Resolver, OniColliderworld and Obi Softbody components, frame rate goes down. Also, the collision stops to work, e.g. the ball goes through the floor.
- I've selected mode 2D, however I'm seeing the ball transform in Z position as well, which I think is not supposed to happen
Thanks

There's a lot of issues with your scene:

- Your floor doesn't need to be a rigidbody if it isn't moving around due to forces/interaction with other objects. If you need it to be for some reason, set it to Kinematic instead of Static. The main performance issue right now is a warning message being spammed to your console, telling you to do this:

Quote:"Cannot use 'velocity' on a static body."

Changing to kinematic stops the console being spammed and the scene runs at +500 fps.

-The floor you're using is extremely thin. This will cause tunneling issues unless the objects colliding against it are really large. The rigidbody sphere is quite large, but the softbody particles are considerably smaller. Just making your floor thicker should fix collisions. For more info on tunneling (which is quite common in all physics engines) see: https://www.youtube.com/watch?v=ms0Z35GY6pk

- You've added a rigidbody component and a collider component to your softbody. This doesn't make any sense. An object can be either a softbody or a rigidbody, not both at once. This will also kill performance because the softbody particles are trying to collide with the collider in a loop, with no hopes of being able to actually resolve the collision. Remove the ObiCollider, ObiRigidbody, CircleCollider2D and Rigidbody2D components from your Circle GameObject. Particle dynamics/collision detection can handle things fine on their own.

- You've not added a ObiSoftbodySkinner component to your softbody, and you're using a MeshRenderer instead of a SkinnedMeshRenderer. This will result in no visible deformation being applied to your mesh. Softbody rendering works by linear-blend skinning your mesh to the underlying particle-based representation of your softbody, just like character deformation works. So for the mesh to deform at all you need to bind it to the softbody simulation. See: http://obi.virtualmethodstudio.com/tutor...inner.html

- The anisotropy neighborhood value in your blueprint is way too large for the size of your mesh. Set it to zero and click Generate to refresh your blueprint.

With these adjustments, here's the result:


(28-12-2020, 09:47 AM)beatrichartz Wrote: - Are there more in depth Obi 2D tutorials available?

2D is exactly the same as 3D, just one dimension less Sonrisa. All existing documentation is directly applicable to both 2D and 3D. Let me know if you need further help with it. cheers!
Reply


Messages In This Thread
Soft Body not colliding 2D mesh - by beatrichartz - 28-12-2020, 09:47 AM
RE: Soft Body not colliding 2D mesh - by josemendez - 28-12-2020, 04:31 PM
RE: Soft Body not colliding 2D mesh - by all2i - 05-04-2021, 12:07 PM