Search Unity

OnTriggerStay

Discussion in 'Physics for ECS' started by shotoutgames, Sep 19, 2020.

  1. shotoutgames

    shotoutgames

    Joined:
    Dec 29, 2013
    Posts:
    290
    Any simple solution.
    I use a raycast currently to check if player touches ground when he lands from a jump but sometimes it misses the check and end up through the grounds physicsShape instead. I want to be able to check when that happens so have the player popup over it.
    I see something like that in the samples but a little complex for me :(
    Thanks
     
  2. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Why does it miss the check? If there's ground below raycast will always hit. Now the problem might be that you are shooting the ray when still in mid air, so you decide it's not at the ground yet, but in the next step it's already penetrating, so you need to recover from penetration. What is your character? Is it a normal rigid body, or something you are simulating on your own? Have you checked the character controller in the samples?
     
    steveeHavok likes this.