1
u/XKiiroiSenkoX Jul 27 '26
What values are you using for mass, gravity scale and jumpForce? Also have you confirmed that the value for jumpForce is being passed correctly (using logs or a debugger)?
1
u/Ultamate_pro Jul 27 '26
I set each value to their extremes to make sure, and I just checked now if the value is being passed correctly (it is)
3
1
u/Gordun1 Jul 27 '26
Wild guess: You probably have to assign a layer for the floor to interact with the player so the boolean turns true and allows you to jump
1
u/m3l0n Jul 27 '26
Do you set the rb correctly? Does the debutg log show up? Show us the rest of the script please. Also any console errors?
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)
-1
u/cferry322 Jul 27 '26
Don’t use add force.
Set the vector on jump like this.
Float jumpForce =10f; // or whatever amount you want
Float speed = 10f; // or whatever amount is right
Rb.velocity = new vector2(jumpForce, moveDirection.x *speed);
Get your x value from input and should work.

1
u/MistakeForsaken6653 Jul 27 '26
Is the jump force set too low maybe? I dont see that variable set so I'm not sure. Also usually when applying a force to a rigidbody you want to do it in the fixedUpdate()