• Unity
  • Used by composite property (Polygon Collider 2D.)

  • Изменено
Related Discussions
...

Hello,
I use a bounding box follower to interact with the entire body of the hero .
To do this, I need to access the field called Used by composite property in Polygon Collider 2D.
(see attachment pic).
Could you help me, how can I do that?

Is it really a good idea to have always-moving, collider transforms with their own rigidbodies to be part of a composite collider? Wouldn't that cause costly a rebuild every frame?

Anyway, you can open BoundingBoxFollowerInspector.cs and comment the hideflag out.
spine-runtimes/BoundingBoxFollower.cs at 3.6
Or add whatever line you want.

Thanks for the quick response


14 Sep 2017, 12:13


Hello,

I added toogle Used by Composite in Bounding Box Follower, and it works in Polygon Collider 2D.(pic.1)
But when I hit play button, RigidBody 2D will add to Polygon Collider 2D.(pic.2)
Could you help, how to prevent adding Rigidbody 2D component, when usedByComposite toogle is true.

It's as I suspected. Unity and Box2D weren't designed to work the way you were attempting.

If the colliders move independently, they shouldn't be part of a composite collider.
If they don't move independently, you can ignore the warning BoneFollower gives you.

But if they do move independently, you'll pay the price of a costly physics body rebuild every frame. Or it will work unpredictably. Or it won't work at all.
That's just how Unity is designed.