hello, how to do to move one object after another at a distance, and to make it easier for me to share it between the tractor and trailer, it’s about the script as a push button that engages in and as I press again splits off. thanks all.
You could use a Hinge Joint. A hinge joint connects two Rigidbodies, and would seem to work well for a tractor and trailer which are directly connected.
However, a Spring Joint might work for two Rigidbodies connected at a distance. A spring joint allows you to specify a min and max distance. This would allow the tractor and trailer to come together gradually when you press the button.
To disable a joint, I believe you can just remove the joint’s connected body by calling
hingeJoint.connectedBody = null;
You can read about all the types of joints and other physics components here.