Search Unity

Question I need help. My character is not jumping.

Discussion in '2D' started by DevTn, Apr 11, 2021.

  1. DevTn

    DevTn

    Joined:
    Apr 11, 2021
    Posts:
    4
    Last edited: Apr 11, 2021
    AKelektronik likes this.
  2. japhib

    japhib

    Joined:
    May 26, 2017
    Posts:
    65
    Maybe add a Debug.Log to see if your collider is colliding at all? Maybe the ground is missing the "ground" tag? Maybe the tag is spelled wrong? There are any number of things that could be happening.

    Just a tip, it's better to post more code and/or screenshots in the post itself instead of having a google drive link so people can answer the question without having to download your whole project
     
  3. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,464
    You need to use OnTriggerEnter2D not OnTriggerEnter (thats for 3D). Also, make sure the object's collider is set to trigger. And do as japhib says, add some debug.logs, those are your best friend.
     
    DevTn likes this.
  4. DevTn

    DevTn

    Joined:
    Apr 11, 2021
    Posts:
    4
    Thanks! I didn't know there was a 2D version of Trigger and Collider events.
     
  5. DevTn

    DevTn

    Joined:
    Apr 11, 2021
    Posts:
    4
    The ground tab was working and the collider should be working since it wouldn't be colliding if it wasn't.
    Thanks for the tip though. I'm kind of new in this community.