I am trying to make a system to handle collision triggers for enemies. With the example on
https://docs.unity3d.com/Packages/com.unity.physics@1.2/manual/simulation-results.html
I have created this class
[UpdateInGroup(typeof(FixedStepSimulationSystemGroup))]
[UpdateAfter(typeof(PhysicsSimulationGroup))]
public partial struct EnemyTriggerEventSystem : ISystem
{
public void OnUpdate(ref SystemState state)
{
var triggerJob = new TriggerJob();
triggerJob.Schedule(SystemAPI.GetSingleton<SimulationSingleton>(), state.Dependency);
}
public partial struct TriggerJob : ITriggerEventsJob
{
public void Execute(TriggerEvent triggerEvent)
{
Debug.Log("Trigger");
}
}
}
which is virtually the same as the example class (and I have also made a script and pasted the example class and had this same error), but I get an error which says:
Ignoring invalid [Unity.Entities.UpdateAfterAttribute] attribute on EnemyTriggerEventSystem targeting Unity.Physics.Systems.PhysicsSimulationGroup. This attribute can only order systems that are members of the same ComponentSystemGroup instance. Make sure that both systems are in the same system group with UpdateInGroup(typeof(Unity.Entities.FixedStepSimulationSystemGroup))], or by manually adding both systems to the same group’s update list.
I have no idea how to fix it, and there doesn’t seem to be any up to date resources to help