I was working on my top down game, but I got stuck. I am trying to make player be knockbacked when an enemy hits him(their rigidbodies collide).
Now the problem is I am using MovePosition for player movement and when I then use anything that will change the velocity of the players RB(setting velocity/AddForce()), the force/velocity is applied just for a split second. I think it is because I use the MovePosition which somehow ignores or resets the velocity.
Is there some way I can go around this without having to make the player controls based on adding forces with max velocity or with calculating how long will the knockback last for?
Shortly, I want the knock back smooth, because now I have to add a really high force to have really fast (basically instant) movement.