Hello, I need help and advice on how to script a behavior for a gameobject (child) that acts as center of gravity for another gameobject (parent). The catch is that this center of gravity should respond to inertial forces, much like in the crude example pic bellow:
EDIT: In a second thought, this pic doesn’t do justice to what I want to describe. Imagine there’s a ball inside your car and that ball is attached by a short rubber band to the center of the car. As you accelerate, brake and turn the ball will roll according to inertia, and them go back to it’s origin as soon as the inertial forces dissipate. That’s kind of what I want to simulate.
As you can see the center of gravity moves slightly in almost the oposite direction of the direction its parent is moving. Since the parent is moved by applying forces to its rigidbody, how can I make the child center of gravity respond accordingly, in a reallistic manner?