Read Collider

Hi,
I am trying to read in the Physics collider for objects that have them so I can then set them at default.
This has to be done at run only but I am trying to find the best method.
I thought about a system that reads and sets but not sure if this is best.
Thanks!

Not sure what you are trying to do.

I am not sure either, but I get the Authoring PhysicsCollider like that in ISystem:

foreach (var physicsCollider in SystemAPI.Query<PhysicsCollider>().WithAll<SomeTagName>())
{
   PhysicsColliderList.somePhysicsCollider = physicsCollider;
}

After that I add PhysicsCollider Component in SystemBase like that:

Entities
   .WithAll<SomeOtherTagName>()
   .ForEach((Entity entity) =>
   {
       ecb.AddComponent(entity, physicsColliderLocal);
   })
   .Run();

It could be SetComponent instead of AddComponent.

2 Likes