Carrying object with MovePosition shaking/vibrate

Hello,I have the possibilty to pick up object, carry them and drop them. That works but while I carrying my object it’s shaking. I am using MovePosition in FixedUpdate() I tried several thing but I can’t fix it. Have you an idea how to resolve it ?
thanks !

here some part on my code :

Update() :

void Update () {
		if(carrying) {

			// the desired position on our carrying object
			carryPosition = mainCamera.transform.position + mainCamera.transform.forward * distance;

			// to avoid possibility the carrying object through the ground
			if (carryPosition.y <= distY) {
				carryPosition.y = distY;
			carriedObject.GetComponent<Rigidbody> ().velocity =;
			carriedObject.GetComponent<Rigidbody> ().angularVelocity;

			// if click on mouse, we drop the carrying object

			// if the object enter in collision with a wall we drop the object
			checkCollision ();
		} else {
			// pick up the object front of the camera


void FixedUpdate(){
		if (carrying) {
			//Move our carrying object to the carryPosition
			carriedObject.GetComponent<Rigidbody> ().MovePosition (carryPosition);

PickUp() :

void pickup() {
		if(Input.GetMouseButtonDown(1)) {
			int x = Screen.width / 2;
			int y = Screen.height / 2;

			Ray ray = mainCamera.GetComponent<Camera>().ScreenPointToRay(new Vector3(x,y));
			RaycastHit hit;
			if(Physics.Raycast(ray, out hit)) {

				// all object which can be pick up have Pickupable.cs as script
				Pickupable p = hit.collider.GetComponent<Pickupable>();
				pick = p;

				// if there is an object pickupable and the distance between the camera and the object is less than distance
				if(p!=null && Vector3.Distance(p.gameObject.transform.position, mainCamera.transform.position) < distance) {
					carrying = true;
					carriedObject = p.gameObject;
					p.gameObject.GetComponent<Rigidbody>().useGravity = false;

					// rotate the object to the defaut rotation
					p.transform.rotation = Quaternion.identity;

					float YOrigin = p.GetComponent<Collider> ();
					float YMin = p.GetComponent<Collider> ().bounds.min.y;

					// the distance from the center of the object to the bottom of the object
					distY = YOrigin - YMin;

Make your carried Object a child Of Your Carrying Object.

use Transform.SetParent , than it will move along her parent (remember to set her local position / rotation Once the object parent is set ), no need to extra script setting the position every frame

and to drop it just detach it from her parent :slight_smile:

You could use mathf.lerp or matf.smoothdamp. Not sure if this will help much but if you have any questions let me know.

Here the same happens! Even localRotation or not! I’m trying to rotate objec in X and Y axis, but only -Y, +Y and -X is working when i rotate +X it shakes