Does anyone know if it's possible to artificially offset/modify a vehicle's center-of-mass/center-of-gravity? I was screwing around with physics and gave a car tires that are super grippy but it makes the car roll over when cornering (for obvious reasons), so I was thinking if I could artificially offset the center of gravity or mass to be a lot lower, it'd reduce it rolling over.
i'm not 100% sure but i would say that's impossible as for now (hope i'm wrong, changing CoM would also be useful to me), i just did a fast-look in the Lua database and it seems that CoG data and its calculation functions are part of the internal (unaccessible) engine code, probably CoG is calculated after sending all the currently active nodes to the engine upon vehicle spawn... BTW you could just attach some heavy nodes at vehicle's floor height (or increase the weight of some existent ones) to try lowering it
The thing was that I wanted to lower the center of mass or gravity significantly (maybe even below the floor?) but without actually making the car heavier than it already is lol. It's a good idea though. I just liked experimenting and I was trying to make the physics feel more "arcadey" by increasing tire grip/friction to handle corners faster, with the car rolling over in turns being the only issue so far lol. Unless someone made a script to apply a downward force on the opposite side of the car where the strength of it increases depending on the strength of the roll.
That shouldn't be too hard, you could add a Lua 'controller' to your wheels so it applies to any car that mounts it, the controller would be something like: get all vehicle nodes on init and filter the ones that weights +4kg or so (so we dont end up applying downward forces onto the windshield, a headlight, or some other fragile thing), then in onUpdate apply a downforce to each node with a formula such S * ( R * nX ) or something like that S = vehicle speed R = roll angular speed nX = node X coord so that the far opposite the nodes are, the more downforce it applies, also multiplied by the fast u go if u have no idea about Lua then forget what i've said haha
A simple way to do this is to add a non-collidable node that weighs like 100kg very far down compared to the car, then lighten some nodes in the roof or something wherever you can to save on the 100kg you just added --- Post updated --- The calculation of the center of mass probably doesn't do much anyways since it's all soft body physics so you can't just tell the engine to shift the weight without shifting the weight if you see what i mean