Search Unity

Detecting Collision with a Character Collider

Discussion in 'Physics' started by SupaChunkySlime, Jun 3, 2021.

  1. SupaChunkySlime

    SupaChunkySlime

    Joined:
    Sep 18, 2020
    Posts:
    2
    So, I'm trying to find a way to make it so when my player hits a wall it takes damage. I already have the damage system set up(I tested it ) but now I was trying to make a collision method that would deal damage to the player with only having a Character Controller and not a box collider on it. I thought it would be simple and I could just put a Box Collider on the player, but I assume because of my movement system or something the floor sort of collapses.

    TL;DR: What I need is a way that I can have just a Character Controller on my player, and execute off of a collision to another object. Thanks!
     
  2. Geckoo

    Geckoo

    Joined:
    Dec 7, 2014
    Posts:
    144
    Hello. You have a collider on your player - a capsule collider. What do you want more so as to detect contact ?
     
    Last edited: Jun 3, 2021
  3. SupaChunkySlime

    SupaChunkySlime

    Joined:
    Sep 18, 2020
    Posts:
    2
    When I use OnCollisionEnter() it doesn’t work
     
  4. Geckoo

    Geckoo

    Joined:
    Dec 7, 2014
    Posts:
    144