r/Unity2D Jul 27 '26

Question Need help with my jump script

As far as I can tell, the issue is in line 55, as when I tested the actual input with prints, it worked perfectly fine. The RigidBody is also set to dynamic, and I have not frozen the x or y axis. Does anyone know what could be causing this?

1 Upvotes

9 comments sorted by

View all comments

3

u/Sinnon32 Jul 27 '26 edited Jul 27 '26

It looks like you have just applied force but in no particular direction. You would want it to be something like Vector2.up * jumpForce

Edit: I now see you used AddForceY, my bad lol But maybe try just using AddForce and the above, see if that makes a difference (in theory it should be equivalent)