Search Unity

Question Any way to check collider touches on demand, (not just in FixedUpdate)

Discussion in 'Physics' started by eV-Interactive, Jan 22, 2021.

  1. eV-Interactive

    eV-Interactive

    Joined:
    Oct 25, 2016
    Posts:
    41
    Hey All - Is there any way to use the physics package to check if colliders are overlapping at an arbitrary time. i.e. in Update()?

    There are some utility functions such as Physics.CheckSphere() but unfortunately they do not return any info about which collider they may be touching.
     
  2. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    You have OverlapSphere that returns all colldiers overlapping/in contact.

    What do you mean "not just in FixedUpdate", you have the same tools there as you have in Update, I thought you are talking about stuff like OnCollision, I'm not clear on your question about arbitrary times.
     
  3. eV-Interactive

    eV-Interactive

    Joined:
    Oct 25, 2016
    Posts:
    41
    Ha,thanks - I totally missed OverlapSphere.

    Here's the problem - VR trackers are updated at Update and just before render-time, so they are too far "ahead" of the physics simulation to do good interaction effects on fast-moving platforms that are controlled by the physics simulation. Trying to find some sort of solution to this.