Search Unity

My player Controller jumps infinitely and really slow.

Discussion in 'Getting Started' started by Dervl3nn4n, Jan 9, 2020.

  1. Dervl3nn4n

    Dervl3nn4n

    Joined:
    Dec 19, 2015
    Posts:
    4
    hi,
    sorry if i post this in the wrong place but i could need some help with my first player controller.
    i followed the Tutorial by Brackeys (
    ).
    atm my controller is working, kinda.
    im following relativly slow and i dont know why because i did it like in the video. if i put my gravity up to around -2500 its fixed but now the jumps are way to short.
    also i can jump infinitely.
    any ideas or tips how i can fix it?
     

    Attached Files:

  2. Dervl3nn4n

    Dervl3nn4n

    Joined:
    Dec 19, 2015
    Posts:
    4
    here a screenshot of my code because i send the data , sorry.
     

    Attached Files:

    • code.PNG
      code.PNG
      File size:
      56.1 KB
      Views:
      381
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Sounds to me like your groundCheck properties are not set correctly, and so it's always detecting ground.

    Test this by displaying the value of isGrounded somehow — either with a Canvas and UI.Text if you've learned about those, or else with Debug.Log. It should turn false as soon as you start a jump, and not become true until you reach the ground again.
     
    Bill_Martini likes this.
  4. Bill_Martini

    Bill_Martini

    Joined:
    Apr 19, 2016
    Posts:
    445
    You can't really expect to have someone review a one hour plus video to find out where you screwed up. Part of becoming a game developer is to debug your code. You can't learn this skill too early. I suggest you go back through the video and double check each line of code and every step taken. Finding errors like this will advance your programming skills far more that a couple of tutorials would.