Any .qc experts in the house?

xzzy

aa
Jan 30, 2010
815
531
I'm trying to make a physics-enabled prop that players can knock around. This part is easy, but fine tuning the behavior to get exactly I want is proving to be pretty difficult.

When using melee or explosives to push a physics object around, it appears Source and/or TF2 scales how much momentum the object picks up based on its physical size. This means two objects with identical mass properties but different sizes will move differently.

For example, if you put in the scout soccer ball at its default size and melee it, it flies around quite a bit. If you scale it up 4 times and try again, it barely moves. This holds true both if I scale the model in the qc file, or in Hammer via the scale override. Setting the other values (mass, inertia, damping) doesn't seem to have any influence on this behavior.

Does anyone know a way around this? I basically want a very large object to respond to explosions as if it were a very small object.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
I'm pretty sure this is related to the mass of the object, but I haven't done the model end too much. Just from experience with size of models and the material they are defining the mass. It could, however, be another fluke in TF2's reduced physics. If you are having a "this should work, but doesn't" situation, it is always a good idea to try it in any other version of Source.
 

xzzy

aa
Jan 30, 2010
815
531
I think maybe I figured it out.. turns out I was missing a setting in the QC called $drag. Apparently the physics simulation has some air resistance coded into it, so when stuff gets bigger it slows down faster. This is probably why large zero mass objects become completely immobile, they can't overcome the air resistance.

I would have thought $damping covered this, but clearly not!

With $drag set to zero I can now have a zero mass object as big as I want and it flies around like it weighs nothing.