I believe that the <mtl_env_init()> function is not getting called by the Event. Therefore, the cubmap is not being generated. Move your init codes into the Starter Function. No entities are assigned this material and so the Event Function will not be executed.