Speed and applied forces randomly change on play?

If i were to hit the play button and play around and then stop everything would work as intended. But at random times when the game starts up, all my could move magnitudes faster or slower and the force of push back from taking damage or inflicting damage can be from flying across the screen or be non existent.

The faster speed is always paired with the increased push back force and slower speed with non existent push back force.

I promise you this can happen with absolutely no changes to code or values in the inspector.

For push back force I am using Rigidbody2D.AddForce()

For movement I’m using something along the lines as

RigidBody2D rb; // Assigned else where

//from game manager
public float GetDifficultyModifier() { return difficultyModifier; }

//from game manager
public void IncreaseDifficulty() { difficultyModifier += difficultyModifierIncrease; }

//from game manager
    public void DecreaseDifficulty() 
        difficultyModifier -= difficultyModifierDecrease; 
        if (difficultyModifier < 0.1f) difficultyModifier = 0.1f; 

modifiedMoveSpeed = gameManager.GetDifficultyModifier() * moveSpeed;

if (Vector2.Distance(enemyTransform.position, playerTransform.position) <
            rb.MovePosition( Vector2.MoveTowards
                (enemyTransform.position, playerTransform.position, enemy.GetModifiedMoveSpeed() * Time.deltaTime));

To explain some of my madness, my enemy movement speed gets a calculated value from a constant moveSpeed and a dynamic difficultyModifer.

The difficulty modifier is adjusted when the player takes damage or damages an enemy.

The changes in speed and force I am experiencing are immediately noticeable so I can confidently say its not my difficulty modifier.


I narrowed it down to be consistently repeatable. The difference happens on Specifically max on play. I tried messing with the size of the screen. Nothing happens. Just max on play.

It is probably as I thought, rb.MovePosition and rb.AddForce can conflict with one another. This answer should help.