Hey there,
So i'm fairly deep into my project, and I want to make what will be a fairly big optimization which is to offload all collision detection to ECS.
My theory is to emulate colliders and their positions in ECS, then whenever there is a collision event I can trigger monobehaviour code.
To create the entity/component data, I have a script i attach to any gameobject that needs collisions to be detected. This script creates the entity and attaches a "collsionTag" component to it, as well as a physics collider, local transform and physics mass (as I believe these physics componets are required to detect collisions). I then also update the entities "local transform" position via the monobehaviour script to align with the gameobject.
Then, in a ISystem, I run a "ICollisionEventsJob" and run my business logic for detecting the correct collisions, where eventually the calling code to monobehaviour functions will be. But i can not for the life of me figure out why my collisions aren't being detected. I've looked into the documentation and it hasn't helped, and also looked at a number of different tutorials and tried to copy what they're doing to no avail.
I'm aware what I am doing might be unconventional, but it would be great if someone could help or point me in the right direction.
Thank you.