I’m new to ECS and I was trying to test basic collision detection based on the following piece of documentation Simulation results | Unity Physics | 1.0.16
It doesn’t seem to be working, I’m not using PhysicsShape (as it is not part of Unity.Physics for some reason) my prefab only has Rigidbody, so I’m confused at this point. Can anyone just confirm that trigger/collision event only work with PhysicsBody from samples repository or is there anything I’m missing?
Apparently, the answer to my question is – yes! It’s far from straightforward (for me as someone who is just trying ECS) that when you install Unity.Physics package you also need to import sample files for any collision/trigger events to be working. Perhaps the documentation can be updated.
Hello,
Iam facing the same problem/issue and would use it if:
Physic Shape and Physic Body is about to get deprecated as some forums-posts do say
Using Physic Shape and Physic Body lead to incorrect collision detection (triggering way before collision actualy happens). So you still are going to use it as us mentioned?
Just saw a Discord-Post:
- Using ITriggerEventsJob with native Collider and Rigidbody works fine
- Using ICollisionEventsJob with native Collider and Rigidbody does not fire events/execute the job
- Switchign to the unity authoring samples Physics Shape and Physics Body, and setting Collide Raise Collision Events as the Collision response on Physics body will let ICollisionEventsJob work as expected
This sucks
Yeah, it would be an understatement to say that I was shocked when I realised that collision events only work with those custom physics components. I was working on a prototype and once I managed to make those events occur, I’ve moved onto other systems. So I haven’t touched the physics since then, but I’m quite satisfied with what I get from ECS overall, hence I will be moving forward with it and will see how it goes
Good to hear. Yet it seems like that collisionevents and triggerevents are raised too early when at least on of two entities colliding vertical. At least with version 1.2.0-pre.6. Just to be aware of, Iam going to raise an issue
I’m not even able to get the provided Collision events example running with 1.2.0-pre.6. I’m getting an error on the .Schedule line: It’s saying it can’t convert SimulationSingleton to JobHandle. I’ve submitted a bug report, but I’d love to get some kind of collision detection without relying on the deprecated Physics Body.