So, everything works fine, but 1 thing. Jumping from connected blocks above ground. Now, as you can see on the picture, the green blobs represent the player, and the black lines is the jumping height. Now, when you jump on top of the connected row of blocks, as you can see, you can't jump far. When I disconnected a block from the group, you could. Lone blocks: high, Multiple blocks: Low. How can I fix this? Jumping function: Code (js): vv that line is lying.. Code (csharp): if(Input.GetKeyDown(KeyCode.Space) && grounded || Input.GetKeyDown("w") && grounded) { grounded = false; Jump(); } } //------------------------ function Jump() { audio.PlayOneShot(jumpSound); rigidbody.AddForce(Vector3.up * 1000); }
There is not enough information available to troubleshoot the problem. What are the specifics for your jumping control, forces and collisions implementations? Based on the limited information provided I would guess that possibly you have some kind of stickiness on a block. The forces of this stickiness are "holding" the player. When two blocks are involved as illustrated in your screenshot it appears the player is actually on top of two different blocks at the same time and perhaps the "sticky" force being applied is double the amount compared to the sticky force being applied from only one block. That may be completely off. Like I said, it is just a "best guess" based on the limited information available.
Well, if you want to ill pm you the script. (its really good, and i'd want to keep it for myself) but heres basically what happens.. kind of.
If you don't want to share the scripts or parts of it, you'll rather have to work with a lot of Debug.Logs on your variables (or print them with the GUI system) so that you can get a basic idea about what's actually going on. As soon as you find values that you didn't expect (for instance, your jump height is totally messed up), you can get step by step closer to the actual problem.
Still no idea, you'll have to work with Debug.Logs on your own. Check the values which are involved in your jumping system and try to find out which part of your code limits the jumping height. That's all i can (still) recommend and i doubt anyone else can help you there without having more information about your code.
As some have said above, the only ways you are going to solve this issue are either by posting the entire script, or doing the debugging yourself. I'm assuming that since you posted here, you want our help. If that is the case, then just post the script and we will be able to help you. If not, do your debugging with Debug.Log. In your player's update method, print out the force being applied to his rigidbody every frame. Maybe print out which blocks are being collided with every frame. There are many different variables that could be causing your issue, and the only way to figure out which one is the problem is to print out all of these values and see which one looks off. Then, you can investigate that specific element further to figure out how to fix it.