ML Agents don't work in WEB GL build

Hello!
I’ve build project with Unity Learn | Karting Microgame | URP | Templates | Unity Asset Store
There are trained ml agent.
When i hit play in editor - all fine.
But when i try build in WebGL and run - my ml agents dont move.

Hey there. I’ll kick this over to the team to check out. Which version of ML Agents, Python, and the editor are you using?

I found root cause. There was a missconfiguration.
Thanks for Repply!
Topic can be closed - all works fine :slight_smile:

1 Like

Happy to hear it! Thanks!

In

I am having the same issue, I saw a few textures that got all wonkie, I will go through and fix those, by swapping out the textures for something else, but the real issue is that My ML Agents don’t work when I upload to WebGL. I don’t know what to do…

1 Like

Also, the ML Agents are half retarded and bump into each other, and go backwards.

What was the miss-configuration?

1 Like

Also having the same issue - ML agents not working in Unity karting Microgame (Aug 2020) when built for WebGL, but working fine in 2019.4 LTS editor.
Using the pre-packaged, pre-trained AI Agents that came with the Aug 2020 Karting microgame.

@TreyK-47 and @tutahexe
Any solutions on this you guys can share?

2 Likes

What was it exactly? Care to share how you have solved it exactly?

It would be helpful to say what the solution was? What configuration needs to be changed exactly?

@tutahexe

@

Did you find a solution? I’ve read somewhere that ML_agents are not supported in WEBGL but I’m not sure if that’s true.

@Darknight747
@
@cp1184

I have found what config is needed.

It’s explained in this video here:

2 Likes

If anyone is still looking, I found the solution on the Karting Creator group - Karting Creators - Unity Connect :

"Youtube Link:

The issue came up around 2:59:53.
Three things you’ve got to do :

  1. Package Manager > Barracuda > Update to version 0.6.3 (Works with WebGL)
  2. Search for KartGame.ai in the Project window (should be the KartGame.ai import settings file) > Enable WebGL in the Platforms section
  3. Search for MLAgentsToolkit in the Project window (once again, should show as Import Settings) > Enable WebGL in the Platforms section This should sort it out, as you just need Unity to be allowed to build the ML agents for WebGL.

I am facing the same issue with Unity2021.3. Can anyone please help? The problem is only happening for WebGL Builds.