2D "Teddy" Shaped Object - How Do I Make it Collide and "Topple" Realistically?

I’ve got an image of a teddybear which, when dropped, will hit one of a number of upright poles and then topple to one side or the other, based on where the pole struck the teddybear.

Currently, I’ve just got the teddy image on a plane, and, obviously the object and its collisions are all based on the plane’s rectangle, so most times it doesn’t look like the pole has hit anything at all, on the teddy.

How do I make both the collision and the physics remotely what you’d expect from something of a certain shape?

For the collisions, do I need to create lots of little colliders, whose size and positions combined roughly match the teddy shape? Or is there a better way to do it? Can I create “something” what tells Unity what the actual outline of the teddy is?

And, will the shape-dependant physical behaviour come hand in hand with the solution to the question above?

What about if I carved my teddybear into smaller pieces? Such as arms, head, legs and body and hinged those all together?

The actual teddy is literally a stuffed toy image, it has no actual animation, and in itself is pretty rigid.

"For the collisions, do I need to create lots of little colliders, whose size and positions combined roughly match the teddy shape?" yes, this is utterly normal in video games. you'd just use say three simple shapes to roughly match the teddy. it's how every game you've ever played works! enjoy.

1 Answer

1

“For the collisions, do I need to create lots of little colliders, whose size and positions combined roughly match the teddy shape?”

Yes. Its difficult for physics to calculate collisions of concave shapes. It is so process intensive that Unity and other game engines don’t even support it, because its not a viable option for real-time simulation. The only option to create concave shapes to create them from several convex shapes, as explained here.

“Can I create “something” what tells Unity what the actual outline of the teddy is?”

Out-of-the-box? No. Unity’s physics engine, and most modern physics engines, uses simple shapes or convex meshes as geometry. Therefore, you can’t really just “tell” Unity to use whatever part of the image is not transparent, since the geometry requires some description of the two types.

“What about if I carved my teddybear into smaller pieces? Such as arms, head, legs and body and hinged those all together?”

If you’re using a static image, it’s probably better that you just use the method on the gun in the link I gave you. Hinging, specifically spring hinges, would probably be better suited for something that is in pieces. That way, the actual visuals of the bear can react realistically and be in sync with any movement that happens in the physics side of things. This video is a good introduction to hinges if you are not aware of how they are used.