I have searched far and wide across the internet for an answer to the question above. I have scrolled through countless other posts and youtube tutorial videos. But I have found no answer.
This should be extremely simple and straightforward, but instead it is extremely convoluted and cryptic, which has been the repeating mantra of ECS so far as I continue to wrestle with this awkwardly designed API.
The thing I am wanting to do is so simple: just add a circle collider to an entity realtime.
Can it be done? Can it be done in a simple way? Can it be done in a way that doesn’t require hours of debugging and reading through the documentation, documentation that was written not to communicate and teach the relevant concepts described, but to haphazardly spew information at you like you’re some dataset that is needing to be set with data?
Spending hours on end trying to do the simplest of things is a major red flag. If there is no simple way to do this that is no more involved than simply adding a few lines which add the necessary collider to the entity, then that is going to be the straw that breaks the camels back, frankly.
Systems can’t just be performant, they need to be designed to be used by human beings, and they should be designed to increase the speed at which work may get done. ECS does the former, but is abysmally bad at the latter.
EDIT: Here is the code block as was requested:
Entity new_foe_entity = ecb.Instantiate(spawner_component.ValueRO.prefab);
ecb.AddComponent(new_foe_entity, new Most_Basic_Foe_Component
{
move_dir = new float3(0, 1, 0),
move_speed = 10
});
ecb.AddComponent(new_foe_entity, new PhysicsVelocity
{
// Set properties for Rigidbody2DComponent
});
ecb.AddComponent(new_foe_entity, new PhysicsDamping
{
// Set properties for CircleCollider2DComponent
});
ecb.AddComponent(new_foe_entity, new PhysicsCollider
{
});