Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Is there an tutorial of doing collider cast with different physics layers?

Discussion in 'Entity Component System' started by YiboInsane, Dec 12, 2022.

  1. YiboInsane

    YiboInsane

    Joined:
    Jul 22, 2019
    Posts:
    16
    Hi guys, I have a scene that has multiple layers for physics: environment/units/bullets. I want to do sphere cast for environment entities only. I am using ECS+physics 1.0pre15 and as far as I know there is no tutorial in using layers. So I wonder if anyone could please help with a link of tutorial or a sample code?

    Best
     
  2. DatCong

    DatCong

    Joined:
    Nov 5, 2020
    Posts:
    77
    it should be in Physics Sample Project !
     
  3. YiboInsane

    YiboInsane

    Joined:
    Jul 22, 2019
    Posts:
    16
    Thanks a lot for the hint! Hmm I guess my brain was fried last night after 10hours of work and was not looking at the right demo scene.
    For anyone who is interested, this is achieved by using Custom Physics Material Tag. Check PhysicsSamples Project->Assets/Demo/3.Query-> CustomCollector scene.
     
    DatCong likes this.