No suitable code replacement generated, this is either due to generators failing, or lack of support

Hi all, updated from 0.51 to 1.0 and cannot continue.

Message:
Unhandled log message: ‘[Exception] InvalidOperationException: No suitable code replacement generated, this is either due to generators failing, or lack of support in your current context’. Use UnityEngine.TestTools.LogAssert.Expect

Code:

pWorldIn = SystemAPI.GetSingleton<PhysicsWorldSingleton>();

SystemAPI.GetSingleton (all SystemAPI bits, really) are documented as currently unsupported for codegen outside the body of system methods, like ISystem.OnUpdate.
https://docs.unity3d.com/Packages/com.unity.entities@1.0/api/Unity.Entities.SystemAPI.GetSingleton.html#Unity_Entities_SystemAPI_GetSingleton__1
You can always replace this with accessor methods from EntityManager + EntityQuery or similar.

2 Likes