Up-to-date collision sample/examples

Hi all,

I’m brand new to unity physics with ECS. There’s been many changes/improvements with the ECS API over the last few years from what I can tell, so much of the ECS/DOTS stuff online is out of date.

Can anyone point me to a good resource that I can use to see how collision detection and events can be processed/handled in systems with the current API?

I assumed I could just grab all my entities with physicsbodies etc. in an Entities.ForEach() and go from there, but I can’t see any examples doing this and those components don’t seem to have the necessary values.

I see lots of examples of casts in the docs (which will be great in future) but for now I just want to start with handling collision/trigger events in ECS.

Thanks in advance!

Hi,

I highly recommend to check out the ECSSamples github repository.

In this there is a UnityPhysicsSamples direcory with a lots of examples. The Assets/Demos/2. Setup/2d. Events/ directory contains great examples how to do collision detection for both colliders and triggers.

Also you may check out the Turbo Makes Games channel (https://www.youtube.com/c/TurboMakesGames), he did a hole series of videos dedicated to ECS physics.

1 Like