Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

What are Physics Shape Custom Tags for?

Discussion in 'Physics for ECS' started by meanfox, May 27, 2020.

  1. meanfox

    meanfox

    Joined:
    Apr 9, 2020
    Posts:
    25
    I was hoping to leverage them in CollisionEvent. That would be useful.

    upload_2020-5-27_14-51-2.png
     

    Attached Files:

  2. Rory_Havok

    Rory_Havok

    Joined:
    Jun 25, 2018
    Posts:
    70
    These are a small payload that travels along with the materials though the simulation step pipeline, and is included in modifier and events so that you can quickly read them. Because they are likely in cache already this is more optimal than looking up data elsewhere (e.g. from another component).
    They are small (8 bits) because we want to keep memory use minimal, so they are really only practical for tagging objects rather than storing any values. So for example you might choose to use bit 0 to tag everything that is "soft" and then use a modifier to apply some custom logic to any contacts that have that tag set.
     
    Last edited: May 27, 2020
  3. meanfox

    meanfox

    Joined:
    Apr 9, 2020
    Posts:
    25
    Thanks Rory