Large Scale Physics?

Hi,
I have a simple chain with a weight on the end using rigidbody and capsule components I prototyped it in the Unity editor and all looks good and works well.

I then brought it into my game scene which is orthographic where the scene scale is 1 unity unit = 1 pixel and so my physics stuff is now all small (but if you zoom in, it’s still working fine). I scaled everything up and now the physics has gone whacko: everything floats for a while and then suddenly goes spastic and flies off in all directions.

I have tweaked all the parameters of both objects and the physics properties like gravity, etc. but can’t get it to work right. Is this fixable?

Thanks,
Brett

What is your gravity set to? I imagine it’s astronomical at that scale.

A little off topic but check out RopeScript (its free) for anything to do with chains and ropes: http://reverieinteractive.com/downloads-2

@quietus

I tried gravity at -10, -100, -1000. At -10 It’s too small so everything is “floaty” and at -100 the object snap off their joints (even though they’re set to infinity) and fly away. Tweaking here and there I can get it approximately right, but it’s very unstable. The slightest bump will oscillate until things fly apart. Very frustrating. The scales aren’t that large. Basically pixel space. So I have capsule in a chain that are about 160 units tall each.

@trooper

Thanks for that. I actually downloaded it and checked it out yesterday. I’m not sure, but I think it also has the same problem, but will check it again today just in case.

Cheers.

PhysX is most stable in scales where one unity unit equates to a meter. The simulation tends to explode when you use extremely small or large scales due to floating point imprecision.

Though I doubt that a 160 meter collider would be in the usual realm of floating point imprecision, it does seem apparent that your 160x scale is doing something. You did say it worked at default scale and physics settings.

Yeah, everything works fine if I just create the capsules and leave them at scale 1. I have a ball swinging on a chain and it looks nice. Take the same thing and scale everything up and it basically stops working. I can’t seem to find a set of values that are stable. But like you said, 160X doesn’t seem so out of range to me.

I must be missing something…

Well you need to deal with the hand you get. Since gravity would need to be 1500 or so in your simulation, it can only get worse not better! Is there no way you can rework your camera so things are in a more realistic scale?

You can also attempt to tweak things into stability by increasing the physics framerate. That would be desirable anyhow when simulating your chain.

Thanks for your suggestions. I have been thinking if I can change to a perspective camera and put everything into meter based units. A lot of work, but yeah, the hand I’m dealt :slight_smile:

Another quick post. I think I might know what’s wrong as I got a test almost working now. At the bigger size, the anchor point positioning was off at the scaled size. I needed to set it so it perfect touched the next rigidbody in the chain. When I scaled everything up these weren’t in the right places. The anchor point follows the scale value so you have to set it as if there is no scaling applied it seems. Hope this solves it…

I had a scene where the character was 0.1 in size. And the physics where working just fine. When I decided to scale up the scene so that my character’s size is 1 I got issues with the physics. The player is falling down slowly and he also bounces up and down when he is on a rigidbody.

Any suggestions to fix that?
Scaling down the scene to 0.1 fixes the issue but that doesn’t make sense.