I am coding a 2D platformer game following this tutorial: https://www.youtube.com/watch?v=6ziIyx60N6I
however instead of using GDScript I am using C# to code. I noticed that the portal scene switching works fine on the Windows build but not on HTML5. On Windows it takes me to the next scene but on HTML5 it just spawns the player but nothing else.
This is how it looks like on Windows:

and this is how it looks on HTML5:

The HTML5 build can be played here: https://mochis-musical-adventure.pages.dev/async-multiplayer-game
Edit: Here's my Portal.cs code
using Godot;
using System;
[Tool]
public class Portal : Area2D
{
[Export] private PackedScene nextScene, testScene;
private AnimationPlayer animationPlayer;
public override void _Ready()
{
animationPlayer = GetNode<AnimationPlayer>("AnimationPlayer");
testScene = ResourceLoader.Load<PackedScene>("res://GameScenes/Level1.tscn");
}
public override string _GetConfigurationWarning()
{
if (nextScene == null)
return "The next scene property can't be empty!";
else
return "";
}
public void _on_body_entered(Area2D _area)
{
teleport();
// maybe change this in future to show a speech bubble prompt to enter the portal?
}
private async void teleport()
{
animationPlayer.Play("fade_to_black");
await ToSignal(animationPlayer, "animation_finished");
GetTree().ChangeSceneTo(nextScene);
}
}