diff --git a/flixel/addons/util/FlxFSM.hx b/flixel/addons/util/FlxFSM.hx index 377ede6c..c34d9a0e 100644 --- a/flixel/addons/util/FlxFSM.hx +++ b/flixel/addons/util/FlxFSM.hx @@ -128,7 +128,12 @@ class FlxFSM implements IFlxDestroyable if (newName != null && !pools.exists(newName)) { - pools.set(newName, new FlxPool>(newStateClass)); + #if (flixel < version("5.4.0")) + final newStateConstructor = newStateClass; + #else + final newStateConstructor = ()->Type.createInstance(newStateClass, []); + #end + pools.set(newName, new FlxPool>(newStateConstructor)); } var returnToPool = state;