I have a setup like this.
BoxCarBase_Object (RB with Gravity)
Box Car Body
Box Car Colliders (to hold coupler)
Coupler Object (RB without Gravity)
Coupler
Coupler Colliders
Knuckle (moving part the connects them togther)
knunckile colliders (to hold cars together)
I have the Ridgidbody(RB) on the BoxCarBase with Gravity. The RB I use on the coupler, I have no gravity and freeze rotation.
I want to have a RB on the coupler so it moves when a connection occurs.
I have the knuckle controlled by a script to be triggered to close (using Itween)
when I don’t have a Rigidbody on the coupler it all works fine, when I do it works unexpectedly when I add movement to the coupler.
when No Rigid body is there, the Knuckle closes, and the cars are locked together(stay locked).
when I have a rigidbody on the coupler, it allows it to do all kinds of whacky stuff. Such as
moving through the colliders on the opposite coupler(copy of prefab)
If I do it slowly, it will couple, but very easily pulls out, so if I move the car, the colliders just pull through each other.
The affect the Rigidbody on the coupler gives, makes it more true to life (the coupler moves a bit as its hooking up)
Without it, its stiff, but works 100%.
I just can’t figure how to control the rigidbody or why it acts so crazy!
