```dart
namespace StarterAssets
{
public class player : MonoBehaviour
{
private AsyncOperation async;
private int index;
void Update()
{
pos();
}
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Portals")
{
StartCoroutine("Load", 1);
}
}
private IEnumerator Load(int num)
{
async = SceneManager.LoadSceneAsync(num);
async.allowSceneActivation = false;
yield return async;
}
void pos()
{
int toProgress;
if(async.progress<0.9f)
{
toProgress = (int)async.progress * 100;
}else
{
toProgress = 100;
}
if(index<toProgress)
{
index++;
}
if(index==100)
{
async.allowSceneActivation=true;
}
}
}
}