Rigidbody.MovePosition - Not working as expected?

One cube, with a rigidbody and two scripts attached:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveRigidbodyDown : MonoBehaviour
{
    Rigidbody _rb;

    // Start is called before the first frame update
    void Start()
    {
        _rb = GetComponent<Rigidbody>();
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        _rb.MovePosition(_rb.position + Vector3.up * -1);
    }
}

and

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveRigidbodyUp : MonoBehaviour
using UnityEngine;

public class MoveRigidbodyUp : MonoBehaviour
{
    Rigidbody _rb;

    // Start is called before the first frame update
    void Start()
    {
        _rb = GetComponent<Rigidbody>();
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        _rb.MovePosition(_rb.position + Vector3.up * 1);
    }
}

The result:

68aar

I would expect the cube to get moved up and then down, or down and then up, depending on script order - therefore leaving the cube where it is. But I’m finding that whichever script is executed last (out of these two) gets executed and the other one seems to get ignored. Am I missing some crucial aspect of this function?

(It was happening in both 2019.2 + 2019.3 beta)

Rigidbody.MovePosition just overrides the result of the physics calculations for the current fixed timestep. As you’re calling MovePosition twice in the same timestep, then only the latest call applies.

A friend tried the same thing out, but their rigidbody stays still. Physics settings are all the same. How can this be?

98dm3

Because two MovePosition calls within the same timestep result in the rigidbody using only the latest value. Although the calls are in different scripts, both FixedUpdate events are invoked within the same timestep.

@Edy that makes sense, but can you see any reason why my friend would be getting different results? As you can see, it seems to be considering both values and cancelling eachother out.