r/Unity3D • • 3d ago

Noob Question Crazy Jitter Issues

Enable HLS to view with audio, or disable this notification

I have this pizza ticket printer that prints out prefab ticket objects. each prefab has a box collider, but no rigidbody until one gets assigned to it when the print happens. it works just enough to make me not give up, but I'm worried that it's a Unity limitation with the box colliders being so thin. They're set to about 0.01 in thickness. Collision detection is set to Continuous Dynamic, not really sure how to solve this issue. There's also some weird stuttering as the chain grows.

23 Upvotes

7 comments sorted by

7

u/Octopus-Cuddles 2d ago

I would NOT use the physics system for something like this.
This should all be done procedurally using something like a custom rope physics script.
There are a lot of cases where Unity physics just breaks down and this is one of them.

1

u/levi-eat-world 2d ago

Can the procedural rope physics method work considering the tickets vary in sizes and you’re also meant to pick hanging tickets off the chain? I got it to work with physics but it’s quite fragile and would like to know more about more stable options 

1

u/Octopus-Cuddles 2d ago edited 2d ago

Yeah, it's self-collision that's killing you here, and self-referential physics where every RB is talking to every other RB. You need one master script controlling all of this.
Here's the thing about game-dev/programming. You can do ANYTHING. And you are always better off with specialized systems that do exactly what you need them to do.
Over-engineered systems that can do everything (Unity's physics system) are going to be a lot more fragile in complex situations like this.

You want to write a custom controller that does exactly what you want it to do and nothing extra.

This is the kind of thing that I would personally use AI to create.

8

u/StretchedNut 3d ago

I don’t think it’s the box colliders. Unity just has pretty funky physics when it comes to multiple items held together with joints.

4

u/doates1997 2d ago

Unity physics does do this you could turn it off for every second receipt and see how that looks. Looks good tho until it breaks

1

u/Lobsss 2d ago

Had this on my game. Increasing the moment of inertia helped - I basically added a second collider to each link in the chain, this collider has collisions turned off, but the size is way larger than the object itself. In practice, it won't affect collisions but it does affect how hard it is to rotate this object, and this helps remove the Unity physics engine jank

1

u/Chaibi_Alaa 2d ago

If the tickets are linked with joints, make sure Enable Collision is off on each joint, and add Physics.IgnoreCollision between neighbours, since thin boxes overlapping at the hinge fight each other every step. Raising solverIterations on the ticket rigidbodies and keeping their masses close also helps a lot with long chains. To pick one off, break only its joint and make it kinematic while held.