Unity here is constantly running physics simulation (trying to mimic the actual world a bit) and thus applies various forces to your rigidbody2d depending on situation. If rigidbody is on the slope there is the downwards force of gravity applied to it. It results in downwards and backwards velocity so that object starts to slide back.
So your problem is - that this backwards/downwards velocity is greater than your forward/upward velocity which you applied.
We can not change physics algorithm, however we can adjust the parameters.
to fix it (and make it behave the way you want) adjust these parameters:
- adjust Mass in Rigidbody2d. Try to increase it. This alone should solve the problem.
- you can lower the slope angle
- apply higher velocity
It should work.. if not Also take a look at - let us know in the commentsRigidbody2D and play around with its parameters until it behaves as you want.