Nope, still not right yet.
without complete code it can be difficult to see what you are doing, but here goes.
first of all, since the jump function is only handling the jump, you should not have to check if updatejump = true. Instead, do that check first, and if it is true, then call the function, rather than calling the function and then checking.
Next, you are checking for if ycam < 7 and applying different forces. What are you doing here? Are you trying to make the jump go up and then down? I assume that is what you are doing, but this is a very bad way to do it. Use velocities, and let gravity forces create the proper arc for you.
Let me try to explain better.
Lets say gravity force = 5.
Lets say Vertical velocity = 0.
Now, when you jump, you set the vertical velocity to 20.
Next, you need to add the velocity to the y position, and then subtract gravity (This will make the vertical velocity now 15)
loop through the last step and you will see that the velocity will eventually equal 0 and start to go into negative numbers. This will mean that you will begin the downward part of the jump.
Look at the example I linked above, it's quite short and should help you.
without complete code it can be difficult to see what you are doing, but here goes.
first of all, since the jump function is only handling the jump, you should not have to check if updatejump = true. Instead, do that check first, and if it is true, then call the function, rather than calling the function and then checking.
Next, you are checking for if ycam < 7 and applying different forces. What are you doing here? Are you trying to make the jump go up and then down? I assume that is what you are doing, but this is a very bad way to do it. Use velocities, and let gravity forces create the proper arc for you.
Let me try to explain better.
Lets say gravity force = 5.
Lets say Vertical velocity = 0.
Now, when you jump, you set the vertical velocity to 20.
Next, you need to add the velocity to the y position, and then subtract gravity (This will make the vertical velocity now 15)
loop through the last step and you will see that the velocity will eventually equal 0 and start to go into negative numbers. This will mean that you will begin the downward part of the jump.
Look at the example I linked above, it's quite short and should help you.