Is it possible to move a Rigidbody both with Physics and Transform?

Is it possible to move a Rigidbody both with Physics and Transform?

I have a 1st person controller that is based on Physics and it works just fine until it enters a vehicle. What I wanted to do was have the controller GameObjected be parented to the vehicle on entry. This is done by attaching this script to the vehicle:

void OnCollisionEnter (Collision other) {
if(other.gameObject.tag == “Player”) {
other.transform.parent = transform;
}

The problem is making the player a child doesn’t work. The vehicle slides along and the player more less remains stationary, until he eventual falls off the vehicle, as if there is no friction to force the player along.

Any ideas?

Rigidbody movement is conflicting with transform movement. Turn his rigidbody component off when he becomes a child.

void OnCollisionEnter (Collision other) {

          if(other.gameObject.tag == "Player") {
 
                     other.transform.parent = transform;
                     other.GetComponent<Rigidbody>().enabled = false;

          }

}

Just remember to turn it back on when you’re ready to give manual control to the player.