Answer the question
In order to leave comments, you need to log in
Why is the component duplicated in the ECS filter?
I made my elementary system on the new unityECS.
The system looks for entities like this:
public class MovementSystem : ComponentSystem
{
public struct Filter
{
public Transform m_Transform;
public MoveComponent m_MoveComponent;
}
protected override void OnUpdate()
{
var entities = GetEntities<Filter>();
Debug.Log(entities.Length);
}
}
Answer the question
In order to leave comments, you need to log in
The problem was not in the place where I expected to see it.
The matter is that I hung up the given component (MoveComponent) on object in runtime.
Because of this, he was not registered in the MovementSystem.
I will look for a way to solve the problem, after which I will supplement the answer.
UPD. For those who are interested: it was necessary to register the newly created Entity in the EntityManager.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question