How to use AddForce and Velocity together

I have the jump component who use the AddForce for jumping and the movement component who move left and right using the Velocity.

If you don’t move the character when your are jumping the jumping will be fine but when you move the character and jump at the same time then the movement component will break the jumping because the velocity is setting up a Vector2 point where define the Y axis too. I tried to use the current Y axis from the transform component in the movement but even that doesn’t work.

What I should do for fix the problem between AddForce and then use Velocity?

Using the current value of velocity.y does work. I’ve done it, and seen plenty of examples here doing it. Probably just a coding error, where you change y by mistake.

But, if you’re using velocity anyway, there’s no reason to use AddForce (it’s just a shortcut that changes velocity for you.) Unless you prefer AddForce, but have to use velocity in one place where AF won’t work.